From a42b1e7fc61d39418b6bcb43f5e15265a9b475f8 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Tue, 27 Feb 2024 18:08:38 +0100 Subject: [PATCH] Show NTP at startup --- build/patches/Show-NTP-at-startup.patch | 200 ++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 build/patches/Show-NTP-at-startup.patch diff --git a/build/patches/Show-NTP-at-startup.patch b/build/patches/Show-NTP-at-startup.patch new file mode 100644 index 00000000..0f442859 --- /dev/null +++ b/build/patches/Show-NTP-at-startup.patch @@ -0,0 +1,200 @@ +From: uazo +Date: Tue, 27 Feb 2024 16:20:43 +0000 +Subject: Show NTP at startup + +Adds an active option by default to automatically open the +NTP at each reboot and allows the user to continue the old browsing. +Until the real tab is opened, no data is retrieved. + +License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html +--- + .../java/res/layout/single_tab_view_layout.xml | 11 +++++++++-- + .../tasks/SingleTabSwitcherOnNtpMediator.java | 8 ++++---- + .../android/java/res/xml/homepage_preferences.xml | 6 ++++++ + .../chrome/browser/ChromeInactivityTracker.java | 13 +++++++++++++ + .../chrome/browser/ChromeTabbedActivity.java | 2 ++ + .../chrome/browser/tasks/ReturnToChromeUtil.java | 6 ++++++ + .../browser/preferences/ChromePreferenceKeys.java | 2 ++ + .../preferences/LegacyChromePreferenceKeys.java | 1 + + .../show-ntp-at-startup.grdp | 9 +++++++++ + .../chrome_feature_list_cc/show-ntp-at-startup.inc | 2 ++ + 10 files changed, 54 insertions(+), 6 deletions(-) + create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/show-ntp-at-startup.grdp + create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/show-ntp-at-startup.inc + +diff --git a/chrome/android/features/start_surface/java/res/layout/single_tab_view_layout.xml b/chrome/android/features/start_surface/java/res/layout/single_tab_view_layout.xml +--- a/chrome/android/features/start_surface/java/res/layout/single_tab_view_layout.xml ++++ b/chrome/android/features/start_surface/java/res/layout/single_tab_view_layout.xml +@@ -36,7 +36,7 @@ found in the LICENSE file. + +@@ -57,11 +57,18 @@ found in the LICENSE file. + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1.0" +- android:layout_marginBottom="10dp" + android:layout_gravity="center_vertical" + android:gravity="center_vertical" + android:singleLine="true" + android:textAppearance="@style/TextAppearance.TextMedium" /> ++ + + + + ++ ++ + ++ ++ ++ Show NTP at startup ++ ++ ++ Enable showing a NewTabPage at startup and allows selection of the last open tab ++ ++ +diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/show-ntp-at-startup.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/show-ntp-at-startup.inc +new file mode 100644 +--- /dev/null ++++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/show-ntp-at-startup.inc +@@ -0,0 +1,2 @@ ++SET_CROMITE_FEATURE_ENABLED(kStartSurfaceReturnTime); ++SET_CROMITE_FEATURE_ENABLED(kShowNtpAtStartupAndroid); +--