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 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 void GetSanitizedEnabledFlags( | 2027 void GetSanitizedEnabledFlags( |
2028 FlagsStorage* flags_storage, std::set<std::string>* result) { | 2028 FlagsStorage* flags_storage, std::set<std::string>* result) { |
2029 SanitizeList(flags_storage); | 2029 SanitizeList(flags_storage); |
2030 *result = flags_storage->GetFlags(); | 2030 *result = flags_storage->GetFlags(); |
2031 } | 2031 } |
2032 | 2032 |
2033 bool SkipConditionalExperiment(const Experiment& experiment, | 2033 bool SkipConditionalExperiment(const Experiment& experiment, |
2034 FlagsStorage* flags_storage) { | 2034 FlagsStorage* flags_storage) { |
2035 if (experiment.internal_name == | 2035 if (experiment.internal_name == |
2036 std::string("enhanced-bookmarks-experiment")) { | 2036 std::string("enhanced-bookmarks-experiment")) { |
| 2037 #if defined(OS_ANDROID) |
| 2038 // On Android, user can opt in. |
| 2039 return false; |
| 2040 #else |
2037 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 2041 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
2038 // Dont't skip experiment if it has non default value. | 2042 // Dont't skip experiment if it has non default value. |
2039 // It means user selected it. | 2043 // It means user selected it. |
2040 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) | 2044 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) |
2041 return false; | 2045 return false; |
2042 | 2046 |
2043 return !IsEnhancedBookmarksExperimentEnabled(flags_storage); | 2047 return !IsEnhancedBookmarksExperimentEnabled(flags_storage); |
| 2048 #endif |
2044 } | 2049 } |
2045 | 2050 |
2046 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || | 2051 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || |
2047 (experiment.internal_name == | 2052 (experiment.internal_name == |
2048 std::string("manual-enhanced-bookmarks-optout"))) { | 2053 std::string("manual-enhanced-bookmarks-optout"))) { |
2049 return true; | 2054 return true; |
2050 } | 2055 } |
2051 | 2056 |
2052 #if defined(OS_ANDROID) | 2057 #if defined(OS_ANDROID) |
2053 // enable-data-reduction-proxy-dev is only available for the Dev channel. | 2058 // enable-data-reduction-proxy-dev is only available for the Dev channel. |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 } | 2515 } |
2511 | 2516 |
2512 const Experiment* GetExperiments(size_t* count) { | 2517 const Experiment* GetExperiments(size_t* count) { |
2513 *count = num_experiments; | 2518 *count = num_experiments; |
2514 return experiments; | 2519 return experiments; |
2515 } | 2520 } |
2516 | 2521 |
2517 } // namespace testing | 2522 } // namespace testing |
2518 | 2523 |
2519 } // namespace about_flags | 2524 } // namespace about_flags |
OLD | NEW |