| 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 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 | 11 |
| 11 class Browser; | 12 class Browser; |
| 12 | 13 |
| 13 namespace extensions { | 14 namespace extensions { |
| 14 class ExtensionMessageBubbleController; | 15 class ExtensionMessageBubbleController; |
| 15 } // namespace extensions | 16 } // namespace extensions |
| 16 | 17 |
| 17 // Create and show ExtensionMessageBubbles for either extensions that look | 18 // Create and show ExtensionMessageBubbles for either extensions that look |
| 18 // suspicious and have therefore been disabled, or for extensions that are | 19 // suspicious and have therefore been disabled, or for extensions that are |
| 19 // running in developer mode that we want to warn the user about. | 20 // running in developer mode that we want to warn the user about. |
| 20 class ExtensionMessageBubbleFactory { | 21 class ExtensionMessageBubbleFactory { |
| 21 public: | 22 public: |
| 22 // An enum to allow us to override the default behavior for testing. | 23 // An enum to allow us to override the default behavior for testing. |
| 23 enum OverrideForTesting { | 24 enum OverrideForTesting { |
| 24 NO_OVERRIDE, | 25 NO_OVERRIDE, |
| 25 OVERRIDE_ENABLED, | 26 OVERRIDE_ENABLED, |
| 26 OVERRIDE_DISABLED, | 27 OVERRIDE_DISABLED, |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 explicit ExtensionMessageBubbleFactory(Browser* browser); | 30 explicit ExtensionMessageBubbleFactory(Browser* browser); |
| 30 ~ExtensionMessageBubbleFactory(); | 31 ~ExtensionMessageBubbleFactory(); |
| 31 | 32 |
| 32 // Returns the controller for the bubble that should be shown, if any. | 33 // Returns the controller for the bubble that should be shown, if any. |
| 33 scoped_ptr<extensions::ExtensionMessageBubbleController> GetController(); | 34 std::unique_ptr<extensions::ExtensionMessageBubbleController> GetController(); |
| 34 | 35 |
| 35 // Overrides the default behavior for testing. | 36 // Overrides the default behavior for testing. |
| 36 static void set_override_for_tests(OverrideForTesting override); | 37 static void set_override_for_tests(OverrideForTesting override); |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 Browser* browser_; | 40 Browser* browser_; |
| 40 | 41 |
| 41 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleFactory); | 42 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleFactory); |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_FACTORY_H_ | 45 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_FACTORY_H_ |
| OLD | NEW |