[NTP] Update NTP flags
Add flag for showing search suggestions on the local NTP.
Add flag for showing promos on the local NTP.
Move kUseGoogleLocalNtp and kDoodlesOnLocalNtp into
ntp_features.
Update flag-metadata for ntp flags.
Bug: 904565, 906278
Change-Id: I465c1f3c42092f491112439260d9fe8546e038a7
Reviewed-on: https://chromium-review.googlesource.com/c/1338233
Reviewed-by: Ramya Nagarajan <[email protected]>
Reviewed-by: Dominic Battré <[email protected]>
Reviewed-by: Elly Fong-Jones <[email protected]>
Commit-Queue: Kyle Milka <[email protected]>
Cr-Commit-Position: refs/heads/master@{#610183}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index babe228..b2b8ebd 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -3464,6 +3464,15 @@
{"doodles-on-local-ntp", flag_descriptions::kDoodlesOnLocalNtpName,
flag_descriptions::kDoodlesOnLocalNtpDescription, kOsDesktop,
FEATURE_VALUE_TYPE(features::kDoodlesOnLocalNtp)},
+
+ {"search-suggestions-on-local-ntp",
+ flag_descriptions::kSearchSuggestionsOnLocalNtpName,
+ flag_descriptions::kSearchSuggestionsOnLocalNtpDescription, kOsDesktop,
+ FEATURE_VALUE_TYPE(features::kSearchSuggestionsOnLocalNtp)},
+
+ {"promos-on-local-ntp", flag_descriptions::kPromosOnLocalNtpName,
+ flag_descriptions::kPromosOnLocalNtpDescription, kOsDesktop,
+ FEATURE_VALUE_TYPE(features::kPromosOnLocalNtp)},
#endif // !defined(OS_ANDROID)
{"sound-content-setting", flag_descriptions::kSoundContentSettingName,
diff --git a/chrome/browser/extensions/api/web_request/web_request_apitest.cc b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
index bb4a583..2f54bd12 100644
--- a/chrome/browser/extensions/api/web_request/web_request_apitest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
@@ -38,6 +38,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_destroyer.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/search/ntp_features.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_loader.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_service.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_service_factory.h"
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 24ff508..e4afab4 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -668,8 +668,8 @@
},
{
"name": "doodles-on-local-ntp",
- // "owners": [ "your-team" ],
- "expiry_milestone": 76
+ "owners": [ "kmilka", "ramyan" ],
+ "expiry_milestone": 74
},
{
"name": "double-tap-to-zoom-in-tablet-mode",
@@ -2470,23 +2470,23 @@
},
{
"name": "ntp-backgrounds",
- // "owners": [ "your-team" ],
- "expiry_milestone": 76
+ "owners": [ "kmilka", "ramyan" ],
+ "expiry_milestone": 73
},
{
"name": "ntp-custom-links",
- // "owners": [ "your-team" ],
- "expiry_milestone": 76
+ "owners": [ "kristipark", "ramyan" ],
+ "expiry_milestone": 73
},
{
"name": "ntp-icons",
- // "owners": [ "your-team" ],
- "expiry_milestone": 76
+ "owners": [ "kristipark", "ramyan" ],
+ "expiry_milestone": 73
},
{
"name": "ntp-ui-md",
- // "owners": [ "your-team" ],
- "expiry_milestone": 76
+ "owners": [ "kmilka", "ramyan" ],
+ "expiry_milestone": 73
},
{
"name": "num-raster-threads",
@@ -2774,6 +2774,11 @@
"expiry_milestone": 76
},
{
+ "name": "promos-on-local-ntp",
+ "owners": ["kmilka", "ramyan"],
+ "expiry_milestone": 74
+ },
+ {
"name": "protect-sync-credential",
// "owners": [ "your-team" ],
"expiry_milestone": 76
@@ -2854,6 +2859,11 @@
"expiry_milestone": 76
},
{
+ "name": "search-suggestions-on-local-ntp",
+ "owners": ["kmilka", "ramyan"],
+ "expiry_milestone": 74
+ },
+ {
"name": "service-worker-payment-apps",
// "owners": [ "your-team" ],
"expiry_milestone": 76
@@ -3160,8 +3170,8 @@
},
{
"name": "use-google-local-ntp",
- // "owners": [ "your-team" ],
- "expiry_milestone": 76
+ "owners": [ "ramyan" ],
+ "expiry_milestone": 75
},
{
"name": "use-monitor-color-space",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index a33078b..13b334a 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2780,6 +2780,17 @@
"Show doodles on the local New Tab page if Google is the default search "
"engine.";
+const char kSearchSuggestionsOnLocalNtpName[] =
+ "Enable search suggestions on the local NTP";
+const char kSearchSuggestionsOnLocalNtpDescription[] =
+ "Show search suggestions on the local New Tab page if Google is the "
+ "default search engine.";
+
+const char kPromosOnLocalNtpName[] = "Enable promos on the local NTP";
+const char kPromosOnLocalNtpDescription[] =
+ "Show promos on the local New Tab page if Google is the "
+ "default search engine.";
+
const char kEnableAudioFocusName[] = "Manage audio focus across tabs";
const char kEnableAudioFocusDescription[] =
"Manage audio focus across tabs to improve the audio mixing.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 7cb7562..d3273937 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1659,6 +1659,12 @@
extern const char kDoodlesOnLocalNtpName[];
extern const char kDoodlesOnLocalNtpDescription[];
+extern const char kSearchSuggestionsOnLocalNtpName[];
+extern const char kSearchSuggestionsOnLocalNtpDescription[];
+
+extern const char kPromosOnLocalNtpName[];
+extern const char kPromosOnLocalNtpDescription[];
+
extern const char kEnableAudioFocusName[];
extern const char kEnableAudioFocusDescription[];
extern const char kEnableAudioFocusDisabled[];
diff --git a/chrome/browser/search/ntp_features.cc b/chrome/browser/search/ntp_features.cc
index 9b4fa88..164e6ba 100644
--- a/chrome/browser/search/ntp_features.cc
+++ b/chrome/browser/search/ntp_features.cc
@@ -10,6 +10,10 @@
namespace features {
+// If enabled, the user will see Doodles on the New Tab Page.
+const base::Feature kDoodlesOnLocalNtp{"DoodlesOnLocalNtp",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
// If enabled, the user will see a configuration UI, and be able to select
// background images to set on the New Tab Page. Implicitly enables |kNtpIcons|.
const base::Feature kNtpBackgrounds{"NewTabPageBackgrounds",
@@ -25,6 +29,18 @@
const base::Feature kNtpUIMd{"NewTabPageUIMd",
base::FEATURE_DISABLED_BY_DEFAULT};
+// If enabled, the user will sometimes see promos on the NTP.
+const base::Feature kPromosOnLocalNtp{"PromosOnLocalNtp",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+// If enabled, the user will sometimes see search suggestions on the NTP.
+const base::Feature kSearchSuggestionsOnLocalNtp{
+ "SearchSuggestionsOnLocalNtp", base::FEATURE_DISABLED_BY_DEFAULT};
+
+// Enables using the local NTP if Google is the default search engine.
+const base::Feature kUseGoogleLocalNtp{"UseGoogleLocalNtp",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
bool IsCustomLinksEnabled() {
return ntp_tiles::IsCustomLinksEnabled();
}
diff --git a/chrome/browser/search/ntp_features.h b/chrome/browser/search/ntp_features.h
index cc591db..e9b36ae 100644
--- a/chrome/browser/search/ntp_features.h
+++ b/chrome/browser/search/ntp_features.h
@@ -12,9 +12,13 @@
// The features should be documented alongside the definition of their values in
// the .cc file.
+extern const base::Feature kDoodlesOnLocalNtp;
extern const base::Feature kNtpBackgrounds;
extern const base::Feature kNtpIcons;
extern const base::Feature kNtpUIMd;
+extern const base::Feature kPromosOnLocalNtp;
+extern const base::Feature kSearchSuggestionsOnLocalNtp;
+extern const base::Feature kUseGoogleLocalNtp;
// Returns whether New Tab Page custom links are enabled.
bool IsCustomLinksEnabled();
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index bd26831..6b0b967 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -11,9 +11,9 @@
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/search/ntp_features.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
-#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "components/google/core/common/google_util.h"
@@ -155,10 +155,13 @@
}
bool ShouldShowLocalNewTab(Profile* profile) {
+#if !defined(OS_ANDROID)
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(switches::kForceLocalNtp) ||
(base::FeatureList::IsEnabled(features::kUseGoogleLocalNtp) &&
profile && DefaultSearchProviderIsGoogle(profile));
+#endif
+ return false;
}
bool ShouldDelayRemoteNTP(const GURL& search_provider_url, Profile* profile) {
diff --git a/chrome/browser/ui/search/local_ntp_doodle_browsertest.cc b/chrome/browser/ui/search/local_ntp_doodle_browsertest.cc
index 9eea1a5..9c6ff43 100644
--- a/chrome/browser/ui/search/local_ntp_doodle_browsertest.cc
+++ b/chrome/browser/ui/search/local_ntp_doodle_browsertest.cc
@@ -14,11 +14,11 @@
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
+#include "chrome/browser/search/ntp_features.h"
#include "chrome/browser/search_provider_logos/logo_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/search/instant_test_utils.h"
#include "chrome/browser/ui/search/local_ntp_test_utils.h"
-#include "chrome/common/chrome_features.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
diff --git a/chrome/browser/ui/search/local_ntp_one_google_bar_browsertest.cc b/chrome/browser/ui/search/local_ntp_one_google_bar_browsertest.cc
index 2cab77df..fd07f0fd 100644
--- a/chrome/browser/ui/search/local_ntp_one_google_bar_browsertest.cc
+++ b/chrome/browser/ui/search/local_ntp_one_google_bar_browsertest.cc
@@ -9,6 +9,7 @@
#include "base/optional.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/search/ntp_features.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_data.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_loader.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_service.h"
@@ -18,7 +19,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/search/instant_test_utils.h"
#include "chrome/browser/ui/search/local_ntp_test_utils.h"
-#include "chrome/common/chrome_features.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
diff --git a/chrome/browser/ui/search/local_ntp_render_browsertest.cc b/chrome/browser/ui/search/local_ntp_render_browsertest.cc
index 6007d99..15bd3238 100644
--- a/chrome/browser/ui/search/local_ntp_render_browsertest.cc
+++ b/chrome/browser/ui/search/local_ntp_render_browsertest.cc
@@ -17,9 +17,9 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/instant_service.h"
#include "chrome/browser/search/instant_service_factory.h"
+#include "chrome/browser/search/ntp_features.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/search/local_ntp_test_utils.h"
-#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/ntp_tiles/constants.h"
diff --git a/chrome/browser/ui/search/local_ntp_voice_search_browsertest.cc b/chrome/browser/ui/search/local_ntp_voice_search_browsertest.cc
index 3d29456..1e8bc483 100644
--- a/chrome/browser/ui/search/local_ntp_voice_search_browsertest.cc
+++ b/chrome/browser/ui/search/local_ntp_voice_search_browsertest.cc
@@ -8,13 +8,13 @@
#include "chrome/browser/permissions/permission_manager_factory.h"
#include "chrome/browser/permissions/permission_request_manager.h"
#include "chrome/browser/permissions/permission_result.h"
+#include "chrome/browser/search/ntp_features.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/permission_bubble/mock_permission_prompt_factory.h"
#include "chrome/browser/ui/search/instant_test_utils.h"
#include "chrome/browser/ui/search/local_ntp_test_utils.h"
-#include "chrome/common/chrome_features.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"