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

Side by Side 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: Formatting fix Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 } 1401 }
1402 1402
1403 if (IsAutoReloadEnabled()) 1403 if (IsAutoReloadEnabled())
1404 command_line->AppendSwitch(switches::kEnableOfflineAutoReload); 1404 command_line->AppendSwitch(switches::kEnableOfflineAutoReload);
1405 if (IsAutoReloadVisibleOnlyEnabled()) { 1405 if (IsAutoReloadVisibleOnlyEnabled()) {
1406 command_line->AppendSwitch( 1406 command_line->AppendSwitch(
1407 switches::kEnableOfflineAutoReloadVisibleOnly); 1407 switches::kEnableOfflineAutoReloadVisibleOnly);
1408 } 1408 }
1409 1409
1410 { 1410 {
1411 // Enable load stale cache if this session is in the field trial or 1411 // Enable showing a saved copy if this session is in the field trial
1412 // the user explicitly enabled it. Note that as far as the renderer 1412 // or the user explicitly enabled it. Note that as far as the
1413 // is concerned, the feature is enabled if-and-only-if the 1413 // renderer is concerned, the feature is enabled if-and-only-if
1414 // kEnableOfflineLoadStaleCache flag is on the command line; 1414 // one of the kEnableShowSavedCopy* switches is on the command
1415 // the yes/no/default behavior is only at the browser command line 1415 // line; the yes/no/default behavior is only at the browser
1416 // level. 1416 // command line level.
1417 1417
1418 // Command line switches override 1418 // Command line switches override
1419 if (browser_command_line.HasSwitch( 1419 const std::string& show_saved_copy_value =
1420 switches::kEnableOfflineLoadStaleCache)) { 1420 browser_command_line.GetSwitchValueASCII(switches::kShowSavedCopy);
1421 command_line->AppendSwitch(switches::kEnableOfflineLoadStaleCache); 1421 if (show_saved_copy_value == switches::kEnableShowSavedCopyPrimary ||
1422 } else if (!browser_command_line.HasSwitch( 1422 show_saved_copy_value == switches::kEnableShowSavedCopySecondary ||
1423 switches::kDisableOfflineLoadStaleCache)) { 1423 show_saved_copy_value == switches::kDisableShowSavedCopy) {
1424 command_line->AppendSwitchASCII(switches::kShowSavedCopy,
1425 show_saved_copy_value);
1426 } else {
1424 std::string group = 1427 std::string group =
1425 base::FieldTrialList::FindFullName("LoadStaleCacheExperiment"); 1428 base::FieldTrialList::FindFullName("LoadStaleCacheExperiment");
1426 1429
1427 if (group == "Enabled") 1430 if (group == "Primary") {
1428 command_line->AppendSwitch(switches::kEnableOfflineLoadStaleCache); 1431 command_line->AppendSwitchNative(
1432 switches::kShowSavedCopy, switches::kEnableShowSavedCopyPrimary);
1433 } else if (group == "Secondary") {
1434 command_line->AppendSwitchNative(
1435 switches::kShowSavedCopy,
1436 switches::kEnableShowSavedCopySecondary);
1437 }
1429 } 1438 }
1430 } 1439 }
1431 1440
1432 // Please keep this in alphabetical order. 1441 // Please keep this in alphabetical order.
1433 static const char* const kSwitchNames[] = { 1442 static const char* const kSwitchNames[] = {
1434 autofill::switches::kDisableFillOnAccountSelect, 1443 autofill::switches::kDisableFillOnAccountSelect,
1435 autofill::switches::kDisablePasswordGeneration, 1444 autofill::switches::kDisablePasswordGeneration,
1436 autofill::switches::kEnableFillOnAccountSelect, 1445 autofill::switches::kEnableFillOnAccountSelect,
1437 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, 1446 autofill::switches::kEnableFillOnAccountSelectNoHighlighting,
1438 autofill::switches::kEnablePasswordGeneration, 1447 autofill::switches::kEnablePasswordGeneration,
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 switches::kDisableWebRtcEncryption, 2648 switches::kDisableWebRtcEncryption,
2640 }; 2649 };
2641 to_command_line->CopySwitchesFrom(from_command_line, 2650 to_command_line->CopySwitchesFrom(from_command_line,
2642 kWebRtcDevSwitchNames, 2651 kWebRtcDevSwitchNames,
2643 arraysize(kWebRtcDevSwitchNames)); 2652 arraysize(kWebRtcDevSwitchNames));
2644 } 2653 }
2645 } 2654 }
2646 #endif // defined(ENABLE_WEBRTC) 2655 #endif // defined(ENABLE_WEBRTC)
2647 2656
2648 } // namespace chrome 2657 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698