OLD | NEW |
---|---|
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 Loading... | |
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 if (browser_command_line.HasSwitch( |
1420 switches::kEnableOfflineLoadStaleCache)) { | 1420 switches::kEnableShowSavedCopyPrimary)) { |
mmenke
2015/02/27 20:27:14
Maybe switch to a single switch with 3 different v
megjablon
2015/02/27 22:41:57
I changed it to a single switch with 3 values. I c
| |
1421 command_line->AppendSwitch(switches::kEnableOfflineLoadStaleCache); | 1421 command_line->AppendSwitch(switches::kEnableShowSavedCopyPrimary); |
1422 } else if (browser_command_line.HasSwitch( | |
1423 switches::kEnableShowSavedCopySecondary)) { | |
1424 command_line->AppendSwitch(switches::kEnableShowSavedCopySecondary); | |
1422 } else if (!browser_command_line.HasSwitch( | 1425 } else if (!browser_command_line.HasSwitch( |
1423 switches::kDisableOfflineLoadStaleCache)) { | 1426 switches::kDisableShowSavedCopy)) { |
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->AppendSwitch(switches::kEnableShowSavedCopyPrimary); |
1432 else if (group == "Secondary") | |
1433 command_line->AppendSwitch(switches::kEnableShowSavedCopySecondary); | |
1429 } | 1434 } |
1430 } | 1435 } |
1431 | 1436 |
1432 // Please keep this in alphabetical order. | 1437 // Please keep this in alphabetical order. |
1433 static const char* const kSwitchNames[] = { | 1438 static const char* const kSwitchNames[] = { |
1434 autofill::switches::kDisableFillOnAccountSelect, | 1439 autofill::switches::kDisableFillOnAccountSelect, |
1435 autofill::switches::kDisablePasswordGeneration, | 1440 autofill::switches::kDisablePasswordGeneration, |
1436 autofill::switches::kEnableFillOnAccountSelect, | 1441 autofill::switches::kEnableFillOnAccountSelect, |
1437 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, | 1442 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, |
1438 autofill::switches::kEnablePasswordGeneration, | 1443 autofill::switches::kEnablePasswordGeneration, |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2639 switches::kDisableWebRtcEncryption, | 2644 switches::kDisableWebRtcEncryption, |
2640 }; | 2645 }; |
2641 to_command_line->CopySwitchesFrom(from_command_line, | 2646 to_command_line->CopySwitchesFrom(from_command_line, |
2642 kWebRtcDevSwitchNames, | 2647 kWebRtcDevSwitchNames, |
2643 arraysize(kWebRtcDevSwitchNames)); | 2648 arraysize(kWebRtcDevSwitchNames)); |
2644 } | 2649 } |
2645 } | 2650 } |
2646 #endif // defined(ENABLE_WEBRTC) | 2651 #endif // defined(ENABLE_WEBRTC) |
2647 | 2652 |
2648 } // namespace chrome | 2653 } // namespace chrome |
OLD | NEW |