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