| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/extensions/extension_message_bubble_factory.h" | 5 #include "chrome/browser/ui/extensions/extension_message_bubble_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" | 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // that are in the different bubble controllers. | 26 // that are in the different bubble controllers. |
| 27 base::LazyInstance<std::set<Profile*> > g_profiles_evaluated = | 27 base::LazyInstance<std::set<Profile*> > g_profiles_evaluated = |
| 28 LAZY_INSTANCE_INITIALIZER; | 28 LAZY_INSTANCE_INITIALIZER; |
| 29 | 29 |
| 30 // This is used to turn on all bubbles for testing. | 30 // This is used to turn on all bubbles for testing. |
| 31 bool g_enabled_for_tests = false; | 31 bool g_enabled_for_tests = false; |
| 32 | 32 |
| 33 const char kEnableDevModeWarningExperimentName[] = | 33 const char kEnableDevModeWarningExperimentName[] = |
| 34 "ExtensionDeveloperModeWarning"; | 34 "ExtensionDeveloperModeWarning"; |
| 35 | 35 |
| 36 #if !defined(OS_WIN) |
| 36 const char kEnableProxyWarningExperimentName[] = "ExtensionProxyWarning"; | 37 const char kEnableProxyWarningExperimentName[] = "ExtensionProxyWarning"; |
| 38 #endif |
| 37 | 39 |
| 38 bool IsExperimentEnabled(const char* experiment_name) { | 40 bool IsExperimentEnabled(const char* experiment_name) { |
| 39 // Don't allow turning it off via command line. | 41 // Don't allow turning it off via command line. |
| 40 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 42 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 41 if (command_line->HasSwitch(switches::kForceFieldTrials)) { | 43 if (command_line->HasSwitch(switches::kForceFieldTrials)) { |
| 42 std::string forced_trials = | 44 std::string forced_trials = |
| 43 command_line->GetSwitchValueASCII(switches::kForceFieldTrials); | 45 command_line->GetSwitchValueASCII(switches::kForceFieldTrials); |
| 44 if (forced_trials.find(experiment_name)) | 46 if (forced_trials.find(experiment_name)) |
| 45 return true; | 47 return true; |
| 46 } | 48 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return controller.Pass(); | 145 return controller.Pass(); |
| 144 } | 146 } |
| 145 | 147 |
| 146 return scoped_ptr<extensions::ExtensionMessageBubbleController>(); | 148 return scoped_ptr<extensions::ExtensionMessageBubbleController>(); |
| 147 } | 149 } |
| 148 | 150 |
| 149 // static | 151 // static |
| 150 void ExtensionMessageBubbleFactory::set_enabled_for_tests(bool enabled) { | 152 void ExtensionMessageBubbleFactory::set_enabled_for_tests(bool enabled) { |
| 151 g_enabled_for_tests = enabled; | 153 g_enabled_for_tests = enabled; |
| 152 } | 154 } |
| OLD | NEW |