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/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" | 8 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" |
| 9 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 9 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 10 #include "chrome/browser/extensions/proxy_overridden_bubble_controller.h" | 10 #include "chrome/browser/extensions/proxy_overridden_bubble_controller.h" |
| 11 #include "chrome/browser/extensions/settings_api_bubble_controller.h" | 11 #include "chrome/browser/extensions/settings_api_bubble_controller.h" |
| 12 #include "chrome/browser/extensions/settings_api_helpers.h" | 12 #include "chrome/browser/extensions/settings_api_helpers.h" |
| 13 #include "chrome/browser/extensions/suspicious_extension_bubble_controller.h" | 13 #include "chrome/browser/extensions/suspicious_extension_bubble_controller.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 // A map of all profiles evaluated, so we can tell if it's the initial check. | 18 // A map of all profiles evaluated, so we can tell if it's the initial check. |
| 19 // TODO(devlin): It would be nice to coalesce all the "profiles evaluated" maps | 19 // TODO(devlin): It would be nice to coalesce all the "profiles evaluated" maps |
| 20 // that are in the different bubble controllers. | 20 // that are in the different bubble controllers. |
| 21 base::LazyInstance<std::set<Profile*> > g_profiles_evaluated = | 21 base::LazyInstance<std::set<Profile*> > g_profiles_evaluated = |
| 22 LAZY_INSTANCE_INITIALIZER; | 22 LAZY_INSTANCE_INITIALIZER; |
| 23 | 23 |
| 24 // Currently, we only show these bubbles on windows platforms. This can be | 24 // Currently, we only show these bubbles on windows platforms. This can be |
| 25 // overridden for testing purposes. | 25 // overridden for testing purposes. |
| 26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 27 bool g_enabled = true; | 27 bool g_enabled = true; |
| 28 #else | 28 #else |
| 29 bool g_enabled = false; | 29 bool g_enabled = true; |
|
Finnur
2015/04/16 09:52:09
Accidental?
Devlin
2015/04/16 15:59:51
Completely. :)
| |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 ExtensionMessageBubbleFactory::ExtensionMessageBubbleFactory(Profile* profile) | 34 ExtensionMessageBubbleFactory::ExtensionMessageBubbleFactory(Profile* profile) |
| 35 : profile_(profile) { | 35 : profile_(profile) { |
| 36 } | 36 } |
| 37 | 37 |
| 38 ExtensionMessageBubbleFactory::~ExtensionMessageBubbleFactory() { | 38 ExtensionMessageBubbleFactory::~ExtensionMessageBubbleFactory() { |
| 39 } | 39 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 return controller.Pass(); | 94 return controller.Pass(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 return scoped_ptr<extensions::ExtensionMessageBubbleController>(); | 97 return scoped_ptr<extensions::ExtensionMessageBubbleController>(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // static | 100 // static |
| 101 void ExtensionMessageBubbleFactory::set_enabled_for_tests(bool enabled) { | 101 void ExtensionMessageBubbleFactory::set_enabled_for_tests(bool enabled) { |
| 102 g_enabled = enabled; | 102 g_enabled = enabled; |
| 103 } | 103 } |
| OLD | NEW |