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

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: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 "enable-apps-show-on-first-paint", 1609 "enable-apps-show-on-first-paint",
1610 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME, 1610 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1611 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION, 1611 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1612 kOsDesktop, 1612 kOsDesktop,
1613 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint) 1613 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
1614 }, 1614 },
1615 { 1615 {
1616 "enhanced-bookmarks-experiment", 1616 "enhanced-bookmarks-experiment",
1617 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, 1617 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1618 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, 1618 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1619 kOsDesktop, 1619 kOsDesktop,
Yaron 2014/08/22 01:13:14 Why is this one not | kOsAndroid also?
Kibeom Kim (inactive) 2014/08/22 07:40:37 Yes, this and below #1632 should also have kOsAndr
1620 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( 1620 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1621 switches::kEnhancedBookmarksExperiment, "1", 1621 switches::kEnhancedBookmarksExperiment, "1",
1622 switches::kEnhancedBookmarksExperiment, "0") 1622 switches::kEnhancedBookmarksExperiment, "0")
1623 }, 1623 },
1624 { 1624 {
1625 "manual-enhanced-bookmarks", 1625 "manual-enhanced-bookmarks",
1626 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, 1626 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1627 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, 1627 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1628 kOsDesktop, 1628 kOsDesktop | kOsAndroid,
1629 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks) 1629 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks)
1630 }, 1630 },
1631 { 1631 {
1632 "manual-enhanced-bookmarks-optout", 1632 "manual-enhanced-bookmarks-optout",
1633 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME, 1633 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1634 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION, 1634 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1635 kOsDesktop, 1635 kOsDesktop,
1636 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout) 1636 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout)
1637 }, 1637 },
1638 #if defined(OS_ANDROID) 1638 #if defined(OS_ANDROID)
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 if (experiment.internal_name == 2021 if (experiment.internal_name ==
2022 std::string("enhanced-bookmarks-experiment")) { 2022 std::string("enhanced-bookmarks-experiment")) {
2023 CommandLine* command_line = CommandLine::ForCurrentProcess(); 2023 CommandLine* command_line = CommandLine::ForCurrentProcess();
2024 // Dont't skip experiment if it has non default value. 2024 // Dont't skip experiment if it has non default value.
2025 // It means user selected it. 2025 // It means user selected it.
2026 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) 2026 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment))
2027 return false; 2027 return false;
2028 2028
2029 return !IsEnhancedBookmarksExperimentEnabled(); 2029 return !IsEnhancedBookmarksExperimentEnabled();
2030 } 2030 }
2031
2032 #if defined(OS_ANDROID)
2033 // manual-enhanced-bookmarks is available for the Android internal channels.
2034 // For other combinations, falls back to the default logic below.
2035 if (experiment.internal_name == std::string("manual-enhanced-bookmarks")) {
2036 switch (chrome::VersionInfo::GetChannel()) {
2037 case chrome::VersionInfo::CHANNEL_UNKNOWN:
2038 case chrome::VersionInfo::CHANNEL_CANARY:
2039 case chrome::VersionInfo::CHANNEL_DEV:
Nico 2014/08/25 00:49:35 Flags shouldn't be channel-specific. See also the
2040 return false;
2041 default:
2042 break;
2043 }
2044 }
2045 #endif
2031 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || 2046 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) ||
2032 (experiment.internal_name == 2047 (experiment.internal_name ==
2033 std::string("manual-enhanced-bookmarks-optout"))) { 2048 std::string("manual-enhanced-bookmarks-optout"))) {
2034 return true; 2049 return true;
2035 } 2050 }
2036 2051
2037 #if defined(OS_ANDROID) 2052 #if defined(OS_ANDROID)
2038 // enable-data-reduction-proxy-dev is only available for the Dev channel. 2053 // enable-data-reduction-proxy-dev is only available for the Dev channel.
2039 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && 2054 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2040 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2055 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 } 2501 }
2487 2502
2488 const Experiment* GetExperiments(size_t* count) { 2503 const Experiment* GetExperiments(size_t* count) {
2489 *count = num_experiments; 2504 *count = num_experiments;
2490 return experiments; 2505 return experiments;
2491 } 2506 }
2492 2507
2493 } // namespace testing 2508 } // namespace testing
2494 2509
2495 } // namespace about_flags 2510 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698