| 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 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 | 2006 |
| 2007 void GetSanitizedEnabledFlags( | 2007 void GetSanitizedEnabledFlags( |
| 2008 FlagsStorage* flags_storage, std::set<std::string>* result) { | 2008 FlagsStorage* flags_storage, std::set<std::string>* result) { |
| 2009 SanitizeList(flags_storage); | 2009 SanitizeList(flags_storage); |
| 2010 *result = flags_storage->GetFlags(); | 2010 *result = flags_storage->GetFlags(); |
| 2011 } | 2011 } |
| 2012 | 2012 |
| 2013 bool SkipConditionalExperiment(const Experiment& experiment) { | 2013 bool SkipConditionalExperiment(const Experiment& experiment) { |
| 2014 if (experiment.internal_name == | 2014 if (experiment.internal_name == |
| 2015 std::string("enhanced-bookmarks-experiment")) { | 2015 std::string("enhanced-bookmarks-experiment")) { |
| 2016 #if defined(OS_ANDROID) |
| 2017 // On Android, user can opt in. |
| 2018 return false; |
| 2019 #else |
| 2016 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 2020 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 2017 // Dont't skip experiment if it has non default value. | 2021 // Dont't skip experiment if it has non default value. |
| 2018 // It means user selected it. | 2022 // It means user selected it. |
| 2019 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) | 2023 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) |
| 2020 return false; | 2024 return false; |
| 2021 | 2025 |
| 2022 return !IsEnhancedBookmarksExperimentEnabled(); | 2026 return !IsEnhancedBookmarksExperimentEnabled(); |
| 2027 #endif |
| 2023 } | 2028 } |
| 2029 |
| 2024 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || | 2030 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || |
| 2025 (experiment.internal_name == | 2031 (experiment.internal_name == |
| 2026 std::string("manual-enhanced-bookmarks-optout"))) { | 2032 std::string("manual-enhanced-bookmarks-optout"))) { |
| 2027 return true; | 2033 return true; |
| 2028 } | 2034 } |
| 2029 | 2035 |
| 2030 #if defined(OS_ANDROID) | 2036 #if defined(OS_ANDROID) |
| 2031 // enable-data-reduction-proxy-dev is only available for the Dev channel. | 2037 // enable-data-reduction-proxy-dev is only available for the Dev channel. |
| 2032 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && | 2038 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && |
| 2033 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { | 2039 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 } | 2486 } |
| 2481 | 2487 |
| 2482 const Experiment* GetExperiments(size_t* count) { | 2488 const Experiment* GetExperiments(size_t* count) { |
| 2483 *count = num_experiments; | 2489 *count = num_experiments; |
| 2484 return experiments; | 2490 return experiments; |
| 2485 } | 2491 } |
| 2486 | 2492 |
| 2487 } // namespace testing | 2493 } // namespace testing |
| 2488 | 2494 |
| 2489 } // namespace about_flags | 2495 } // namespace about_flags |
| OLD | NEW |