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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 return g_override_for_testing == | 78 return g_override_for_testing == |
| 78 ExtensionMessageBubbleFactory::OVERRIDE_ENABLED || | 79 ExtensionMessageBubbleFactory::OVERRIDE_ENABLED || |
| 79 IsExperimentEnabled(kEnableProxyWarningExperimentName); | 80 IsExperimentEnabled(kEnableProxyWarningExperimentName); |
| 80 #endif | 81 #endif |
| 81 } | 82 } |
| 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 |
| 88 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
|
Devlin
2017/02/06 16:20:21
We should add a comment here like:
// If ChromeDri
samuong
2017/02/07 19:11:09
Done.
| |
| 89 if (command_line->HasSwitch(switches::kEnableChromeDriver)) | |
| 90 return false; | |
| 91 | |
| 87 #if defined(OS_WIN) | 92 #if defined(OS_WIN) |
| 88 if (chrome::GetChannel() >= version_info::Channel::BETA) | 93 if (chrome::GetChannel() >= version_info::Channel::BETA) |
| 89 return true; | 94 return true; |
| 90 #endif | 95 #endif |
| 91 | 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 |
| (...skipping 72 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 |