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

Side by Side Diff: chrome/browser/about_flags.cc

Issue 497563002: [Android] Use correct enhanced bookmarks enabling logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: indent fix Created 6 years, 3 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/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 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 "enable-apps-show-on-first-paint", 1597 "enable-apps-show-on-first-paint",
1598 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME, 1598 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1599 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION, 1599 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1600 kOsDesktop, 1600 kOsDesktop,
1601 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint) 1601 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
1602 }, 1602 },
1603 { 1603 {
1604 "enhanced-bookmarks-experiment", 1604 "enhanced-bookmarks-experiment",
1605 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, 1605 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1606 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, 1606 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1607 kOsDesktop, 1607 kOsDesktop | kOsAndroid,
1608 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( 1608 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1609 switches::kEnhancedBookmarksExperiment, "1", 1609 switches::kEnhancedBookmarksExperiment, "1",
1610 switches::kEnhancedBookmarksExperiment, "0") 1610 switches::kEnhancedBookmarksExperiment, "0")
1611 }, 1611 },
1612 { 1612 {
1613 "manual-enhanced-bookmarks", 1613 "manual-enhanced-bookmarks",
1614 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, 1614 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1615 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, 1615 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1616 kOsDesktop, 1616 kOsDesktop | kOsAndroid,
1617 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks) 1617 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks)
1618 }, 1618 },
1619 { 1619 {
1620 "manual-enhanced-bookmarks-optout", 1620 "manual-enhanced-bookmarks-optout",
1621 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, 1621 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1622 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, 1622 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1623 kOsDesktop, 1623 kOsDesktop | kOsAndroid,
1624 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout) 1624 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout)
1625 }, 1625 },
1626 #if defined(OS_ANDROID) 1626 #if defined(OS_ANDROID)
1627 { 1627 {
1628 "enable-zero-suggest-experiment", 1628 "enable-zero-suggest-experiment",
1629 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME, 1629 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME,
1630 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION, 1630 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION,
1631 kOsAndroid, 1631 kOsAndroid,
1632 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices) 1632 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices)
1633 }, 1633 },
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 2018
2019 void GetSanitizedEnabledFlags( 2019 void GetSanitizedEnabledFlags(
2020 FlagsStorage* flags_storage, std::set<std::string>* result) { 2020 FlagsStorage* flags_storage, std::set<std::string>* result) {
2021 SanitizeList(flags_storage); 2021 SanitizeList(flags_storage);
2022 *result = flags_storage->GetFlags(); 2022 *result = flags_storage->GetFlags();
2023 } 2023 }
2024 2024
2025 bool SkipConditionalExperiment(const Experiment& experiment) { 2025 bool SkipConditionalExperiment(const Experiment& experiment) {
2026 if (experiment.internal_name == 2026 if (experiment.internal_name ==
2027 std::string("enhanced-bookmarks-experiment")) { 2027 std::string("enhanced-bookmarks-experiment")) {
2028 #if defined(OS_ANDROID)
2029 // On Android, user can opt in.
2030 return false;
2031 #else
2028 CommandLine* command_line = CommandLine::ForCurrentProcess(); 2032 CommandLine* command_line = CommandLine::ForCurrentProcess();
2029 // Dont't skip experiment if it has non default value. 2033 // Dont't skip experiment if it has non default value.
2030 // It means user selected it. 2034 // It means user selected it.
2031 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) 2035 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment))
2032 return false; 2036 return false;
2033 2037
2034 return !IsEnhancedBookmarksExperimentEnabled(); 2038 return !IsEnhancedBookmarksExperimentEnabled();
2039 #endif
2035 } 2040 }
2041
2036 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || 2042 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) ||
2037 (experiment.internal_name == 2043 (experiment.internal_name ==
2038 std::string("manual-enhanced-bookmarks-optout"))) { 2044 std::string("manual-enhanced-bookmarks-optout"))) {
2039 return true; 2045 return true;
2040 } 2046 }
2041 2047
2042 #if defined(OS_ANDROID) 2048 #if defined(OS_ANDROID)
2043 // enable-data-reduction-proxy-dev is only available for the Dev channel. 2049 // enable-data-reduction-proxy-dev is only available for the Dev channel.
2044 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && 2050 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2045 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2051 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2491 } 2497 }
2492 2498
2493 const Experiment* GetExperiments(size_t* count) { 2499 const Experiment* GetExperiments(size_t* count) {
2494 *count = num_experiments; 2500 *count = num_experiments;
2495 return experiments; 2501 return experiments;
2496 } 2502 }
2497 2503
2498 } // namespace testing 2504 } // namespace testing
2499 2505
2500 } // namespace about_flags 2506 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698