Chromium Code Reviews| 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/base_switches.h" | 7 #include "base/base_switches.h" | 
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" | 
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" | 
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" | 
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" | 
| 12 #include "chrome/browser/extensions/dev_mode_bubble_delegate.h" | 12 #include "chrome/browser/extensions/dev_mode_bubble_delegate.h" | 
| 13 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 13 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 
| 14 #include "chrome/browser/extensions/install_verifier.h" | 14 #include "chrome/browser/extensions/install_verifier.h" | 
| 15 #include "chrome/browser/extensions/proxy_overridden_bubble_delegate.h" | 15 #include "chrome/browser/extensions/proxy_overridden_bubble_delegate.h" | 
| 16 #include "chrome/browser/extensions/settings_api_bubble_delegate.h" | 16 #include "chrome/browser/extensions/settings_api_bubble_delegate.h" | 
| 17 #include "chrome/browser/extensions/settings_api_helpers.h" | 17 #include "chrome/browser/extensions/settings_api_helpers.h" | 
| 18 #include "chrome/browser/extensions/suspicious_extension_bubble_delegate.h" | 18 #include "chrome/browser/extensions/suspicious_extension_bubble_delegate.h" | 
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" | 
| 20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" | 
| 21 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 21 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 
| 22 #include "chrome/common/channel_info.h" | 22 #include "chrome/common/channel_info.h" | 
| 23 #include "components/version_info/version_info.h" | 23 #include "components/version_info/version_info.h" | 
| 24 #include "content/public/common/content_switches.h" | |
| 24 #include "extensions/common/feature_switch.h" | 25 #include "extensions/common/feature_switch.h" | 
| 25 | 26 | 
| 26 namespace { | 27 namespace { | 
| 27 | 28 | 
| 28 // A map of all profiles evaluated, so we can tell if it's the initial check. | 29 // A map of all profiles evaluated, so we can tell if it's the initial check. | 
| 29 // TODO(devlin): It would be nice to coalesce all the "profiles evaluated" maps | 30 // TODO(devlin): It would be nice to coalesce all the "profiles evaluated" maps | 
| 30 // that are in the different bubble controllers. | 31 // that are in the different bubble controllers. | 
| 31 base::LazyInstance<std::set<Profile*> > g_profiles_evaluated = | 32 base::LazyInstance<std::set<Profile*> > g_profiles_evaluated = | 
| 32 LAZY_INSTANCE_INITIALIZER; | 33 LAZY_INSTANCE_INITIALIZER; | 
| 33 | 34 | 
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 | 83 | 
| 83 bool EnableDevModeBubble() { | 84 bool EnableDevModeBubble() { | 
| 84 if (extensions::FeatureSwitch::force_dev_mode_highlighting()->IsEnabled()) | 85 if (extensions::FeatureSwitch::force_dev_mode_highlighting()->IsEnabled()) | 
| 85 return true; | 86 return true; | 
| 86 | 87 | 
| 87 #if defined(OS_WIN) | 88 #if defined(OS_WIN) | 
| 88 if (chrome::GetChannel() >= version_info::Channel::BETA) | 89 if (chrome::GetChannel() >= version_info::Channel::BETA) | 
| 89 return true; | 90 return true; | 
| 90 #endif | 91 #endif | 
| 91 | 92 | 
| 93 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 94 if (command_line->HasSwitch(switches::kEnableChromeDriver)) | |
| 95 return false; | |
| 
 
Devlin
2017/02/01 23:05:00
On Windows beta and stable, we've already returned
 
samuong
2017/02/04 00:11:03
Done.
 
 | |
| 96 | |
| 92 return g_override_for_testing == | 97 return g_override_for_testing == | 
| 93 ExtensionMessageBubbleFactory::OVERRIDE_ENABLED || | 98 ExtensionMessageBubbleFactory::OVERRIDE_ENABLED || | 
| 94 IsExperimentEnabled(kEnableDevModeWarningExperimentName); | 99 IsExperimentEnabled(kEnableDevModeWarningExperimentName); | 
| 95 } | 100 } | 
| 96 | 101 | 
| 97 } // namespace | 102 } // namespace | 
| 98 | 103 | 
| 99 ExtensionMessageBubbleFactory::ExtensionMessageBubbleFactory(Browser* browser) | 104 ExtensionMessageBubbleFactory::ExtensionMessageBubbleFactory(Browser* browser) | 
| 100 : browser_(browser) { | 105 : browser_(browser) { | 
| 101 } | 106 } | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 | 174 | 
| 170 controller.reset(); | 175 controller.reset(); | 
| 171 return controller; | 176 return controller; | 
| 172 } | 177 } | 
| 173 | 178 | 
| 174 // static | 179 // static | 
| 175 void ExtensionMessageBubbleFactory::set_override_for_tests( | 180 void ExtensionMessageBubbleFactory::set_override_for_tests( | 
| 176 OverrideForTesting override) { | 181 OverrideForTesting override) { | 
| 177 g_override_for_testing = override; | 182 g_override_for_testing = override; | 
| 178 } | 183 } | 
| OLD | NEW |