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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 961443002: Three way experiment for "Show saved copy" button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: histograms fix Created 5 years, 10 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/about_flags.cc ('k') | chrome/browser/errorpage_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index be00c5c456562636282576bdfb0288ac96e48f09..f2d9b60cb2873b1779ed51341bc2ed72f1961d38 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1409,24 +1409,33 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
}
{
- // Enable load stale cache if this session is in the field trial or
- // the user explicitly enabled it. Note that as far as the renderer
- // is concerned, the feature is enabled if-and-only-if the
- // kEnableOfflineLoadStaleCache flag is on the command line;
- // the yes/no/default behavior is only at the browser command line
- // level.
+ // Enable showing a saved copy if this session is in the field trial
+ // or the user explicitly enabled it. Note that as far as the
+ // renderer is concerned, the feature is enabled if-and-only-if
+ // one of the kEnableShowSavedCopy* switches is on the command
+ // line; the yes/no/default behavior is only at the browser
+ // command line level.
// Command line switches override
- if (browser_command_line.HasSwitch(
- switches::kEnableOfflineLoadStaleCache)) {
- command_line->AppendSwitch(switches::kEnableOfflineLoadStaleCache);
- } else if (!browser_command_line.HasSwitch(
- switches::kDisableOfflineLoadStaleCache)) {
+ const std::string& show_saved_copy_value =
+ browser_command_line.GetSwitchValueASCII(switches::kShowSavedCopy);
+ if (show_saved_copy_value == switches::kEnableShowSavedCopyPrimary ||
+ show_saved_copy_value == switches::kEnableShowSavedCopySecondary ||
+ show_saved_copy_value == switches::kDisableShowSavedCopy) {
+ command_line->AppendSwitchASCII(switches::kShowSavedCopy,
+ show_saved_copy_value);
+ } else {
std::string group =
base::FieldTrialList::FindFullName("LoadStaleCacheExperiment");
- if (group == "Enabled")
- command_line->AppendSwitch(switches::kEnableOfflineLoadStaleCache);
+ if (group == "Primary") {
+ command_line->AppendSwitchASCII(
+ switches::kShowSavedCopy, switches::kEnableShowSavedCopyPrimary);
+ } else if (group == "Secondary") {
+ command_line->AppendSwitchASCII(
+ switches::kShowSavedCopy,
+ switches::kEnableShowSavedCopySecondary);
+ }
}
}
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/errorpage_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698