Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6856)

Unified Diff: chrome/browser/about_flags.cc

Issue 2763613002: Add DelayNavigationThrottle (Closed)
Patch Set: add dchecks Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 52bea44952d5d5d1791b5a14182fc2e6f8bc194c..b3053a69232082c415dc1f7ab3e23d7b6a73405b 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -27,6 +27,7 @@
#include "build/build_config.h"
#include "cc/base/switches.h"
#include "chrome/browser/ntp_snippets/ntp_snippets_features.h"
+#include "chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.h"
#include "chrome/browser/predictors/resource_prefetch_common.h"
#include "chrome/browser/prerender/prerender_field_trial.h"
#include "chrome/common/channel_info.h"
@@ -756,6 +757,27 @@ const FeatureEntry::FeatureVariation
arraysize(kAutofillCreditCardLastUsedDateFeatureVariationExpDate),
nullptr}};
+const FeatureEntry::FeatureParam kDelayNavigation5SecondDelay[] = {
+ {DelayNavigationThrottle::kParamDelayNavigationDurationMillis, "5000"},
+ {DelayNavigationThrottle::kParamDelayNavigationProbability, "1"}};
+
+const FeatureEntry::FeatureParam kDelayNavigation5SecondDelay25Percent[] = {
+ {DelayNavigationThrottle::kParamDelayNavigationDurationMillis, "5000"},
+ {DelayNavigationThrottle::kParamDelayNavigationProbability, "0.25"}};
+
+const FeatureEntry::FeatureParam kDelayNavigation5SecondDelayRandomize[] = {
+ {DelayNavigationThrottle::kParamDelayNavigationDurationMillis, "5000"},
+ {DelayNavigationThrottle::kParamDelayNavigationProbability, "1"},
+ {DelayNavigationThrottle::kParamDelayNavigationRandomize, "true"}};
+
+const FeatureEntry::FeatureVariation kDelayNavigationFeatureVariations[] = {
+ {"(5 second delay, 100% probability)", kDelayNavigation5SecondDelay,
+ arraysize(kDelayNavigation5SecondDelay), nullptr},
+ {"(5 second delay, 25% probability)", kDelayNavigation5SecondDelay25Percent,
+ arraysize(kDelayNavigation5SecondDelay25Percent), nullptr},
+ {"(0-5 second randomized delay)", kDelayNavigation5SecondDelayRandomize,
+ arraysize(kDelayNavigation5SecondDelayRandomize), nullptr}};
+
// RECORDING USER METRICS FOR FLAGS:
// -----------------------------------------------------------------------------
// The first line of the entry is the internal name.
@@ -2397,6 +2419,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(chrome::android::kUseNewDoodleApi)},
#endif // OS_ANDROID
+ {"delay-navigation", IDS_FLAGS_DELAY_NAVIGATION_NAME,
+ IDS_FLAGS_DELAY_NAVIGATION_DESCRIPTION, kOsAll,
+ FEATURE_WITH_PARAMS_VALUE_TYPE(kDelayNavigationFeature,
+ kDelayNavigationFeatureVariations,
+ "DelayNavigation")},
+
// NOTE: Adding new command-line switches requires adding corresponding
// entries to enum "LoginCustomFlags" in histograms.xml. See note in
// histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698