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/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 "enable-apps-show-on-first-paint", | 1587 "enable-apps-show-on-first-paint", |
1588 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME, | 1588 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME, |
1589 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION, | 1589 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION, |
1590 kOsDesktop, | 1590 kOsDesktop, |
1591 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint) | 1591 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint) |
1592 }, | 1592 }, |
1593 { | 1593 { |
1594 "enhanced-bookmarks-experiment", | 1594 "enhanced-bookmarks-experiment", |
1595 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, | 1595 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, |
1596 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, | 1596 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, |
1597 kOsDesktop, | 1597 kOsDesktop | kOsAndroid, |
1598 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( | 1598 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
1599 switches::kEnhancedBookmarksExperiment, "1", | 1599 switches::kEnhancedBookmarksExperiment, "1", |
1600 switches::kEnhancedBookmarksExperiment, "0") | 1600 switches::kEnhancedBookmarksExperiment, "0") |
1601 }, | 1601 }, |
1602 { | 1602 { |
1603 "manual-enhanced-bookmarks", | 1603 "manual-enhanced-bookmarks", |
1604 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, | 1604 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, |
1605 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, | 1605 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, |
1606 kOsDesktop, | 1606 kOsDesktop | kOsAndroid, |
1607 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks) | 1607 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks) |
1608 }, | 1608 }, |
1609 { | 1609 { |
1610 "manual-enhanced-bookmarks-optout", | 1610 "manual-enhanced-bookmarks-optout", |
1611 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, | 1611 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, |
1612 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, | 1612 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, |
1613 kOsDesktop, | 1613 kOsDesktop | kOsAndroid, |
1614 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout) | 1614 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout) |
1615 }, | 1615 }, |
1616 #if defined(OS_ANDROID) | 1616 #if defined(OS_ANDROID) |
1617 { | 1617 { |
1618 "enable-zero-suggest-experiment", | 1618 "enable-zero-suggest-experiment", |
1619 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME, | 1619 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME, |
1620 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION, | 1620 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION, |
1621 kOsAndroid, | 1621 kOsAndroid, |
1622 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices) | 1622 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices) |
1623 }, | 1623 }, |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1991 | 1991 |
1992 void GetSanitizedEnabledFlags( | 1992 void GetSanitizedEnabledFlags( |
1993 FlagsStorage* flags_storage, std::set<std::string>* result) { | 1993 FlagsStorage* flags_storage, std::set<std::string>* result) { |
1994 SanitizeList(flags_storage); | 1994 SanitizeList(flags_storage); |
1995 *result = flags_storage->GetFlags(); | 1995 *result = flags_storage->GetFlags(); |
1996 } | 1996 } |
1997 | 1997 |
1998 bool SkipConditionalExperiment(const Experiment& experiment) { | 1998 bool SkipConditionalExperiment(const Experiment& experiment) { |
1999 if (experiment.internal_name == | 1999 if (experiment.internal_name == |
2000 std::string("enhanced-bookmarks-experiment")) { | 2000 std::string("enhanced-bookmarks-experiment")) { |
| 2001 #if defined(OS_ANDROID) |
| 2002 // On Android, user can opt in. |
| 2003 return false; |
| 2004 #else |
2001 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 2005 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
2002 // Dont't skip experiment if it has non default value. | 2006 // Dont't skip experiment if it has non default value. |
2003 // It means user selected it. | 2007 // It means user selected it. |
2004 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) | 2008 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) |
2005 return false; | 2009 return false; |
2006 | 2010 |
2007 return !IsEnhancedBookmarksExperimentEnabled(); | 2011 return !IsEnhancedBookmarksExperimentEnabled(); |
| 2012 #endif |
2008 } | 2013 } |
| 2014 |
2009 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || | 2015 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || |
2010 (experiment.internal_name == | 2016 (experiment.internal_name == |
2011 std::string("manual-enhanced-bookmarks-optout"))) { | 2017 std::string("manual-enhanced-bookmarks-optout"))) { |
2012 return true; | 2018 return true; |
2013 } | 2019 } |
2014 | 2020 |
2015 #if defined(OS_ANDROID) | 2021 #if defined(OS_ANDROID) |
2016 // enable-data-reduction-proxy-dev is only available for the Dev channel. | 2022 // enable-data-reduction-proxy-dev is only available for the Dev channel. |
2017 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && | 2023 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && |
2018 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { | 2024 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2464 } | 2470 } |
2465 | 2471 |
2466 const Experiment* GetExperiments(size_t* count) { | 2472 const Experiment* GetExperiments(size_t* count) { |
2467 *count = num_experiments; | 2473 *count = num_experiments; |
2468 return experiments; | 2474 return experiments; |
2469 } | 2475 } |
2470 | 2476 |
2471 } // namespace testing | 2477 } // namespace testing |
2472 | 2478 |
2473 } // namespace about_flags | 2479 } // namespace about_flags |
OLD | NEW |