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 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1999 | 1999 |
2000 void GetSanitizedEnabledFlags( | 2000 void GetSanitizedEnabledFlags( |
2001 FlagsStorage* flags_storage, std::set<std::string>* result) { | 2001 FlagsStorage* flags_storage, std::set<std::string>* result) { |
2002 SanitizeList(flags_storage); | 2002 SanitizeList(flags_storage); |
2003 *result = flags_storage->GetFlags(); | 2003 *result = flags_storage->GetFlags(); |
2004 } | 2004 } |
2005 | 2005 |
2006 bool SkipConditionalExperiment(const Experiment& experiment) { | 2006 bool SkipConditionalExperiment(const Experiment& experiment) { |
2007 if (experiment.internal_name == | 2007 if (experiment.internal_name == |
2008 std::string("enhanced-bookmarks-experiment")) { | 2008 std::string("enhanced-bookmarks-experiment")) { |
2009 #if defined(OS_ANDROID) | |
2010 // On Android, user can opt in. | |
2011 return false; | |
2012 #else | |
2009 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 2013 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
2010 // Dont't skip experiment if it has non default value. | 2014 // Dont't skip experiment if it has non default value. |
2011 // It means user selected it. | 2015 // It means user selected it. |
2012 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) | 2016 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) |
2013 return false; | 2017 return false; |
2014 | 2018 |
2015 return !IsEnhancedBookmarksExperimentEnabled(); | 2019 return !IsEnhancedBookmarksExperimentEnabled(); |
Nico
2014/09/04 18:35:25
Why is this code needed?
Kibeom Kim (inactive)
2014/09/04 18:40:49
For desktop, we enable the experiment by chrome sy
Nico
2014/09/04 18:42:28
The way this is usually done is to have a "Enable
| |
2020 #endif | |
2016 } | 2021 } |
2022 | |
2017 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || | 2023 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || |
2018 (experiment.internal_name == | 2024 (experiment.internal_name == |
2019 std::string("manual-enhanced-bookmarks-optout"))) { | 2025 std::string("manual-enhanced-bookmarks-optout"))) { |
2020 return true; | 2026 return true; |
2021 } | 2027 } |
2022 | 2028 |
2023 #if defined(OS_ANDROID) | 2029 #if defined(OS_ANDROID) |
2024 // enable-data-reduction-proxy-dev is only available for the Dev channel. | 2030 // enable-data-reduction-proxy-dev is only available for the Dev channel. |
2025 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && | 2031 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && |
2026 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { | 2032 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2473 } | 2479 } |
2474 | 2480 |
2475 const Experiment* GetExperiments(size_t* count) { | 2481 const Experiment* GetExperiments(size_t* count) { |
2476 *count = num_experiments; | 2482 *count = num_experiments; |
2477 return experiments; | 2483 return experiments; |
2478 } | 2484 } |
2479 | 2485 |
2480 } // namespace testing | 2486 } // namespace testing |
2481 | 2487 |
2482 } // namespace about_flags | 2488 } // namespace about_flags |
OLD | NEW |