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_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_ |
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_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 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" | 11 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" |
11 | 12 |
12 @class ToolbarActionsBarBubbleMac; | 13 @class ToolbarActionsBarBubbleMac; |
13 | 14 |
14 namespace extensions { | 15 namespace extensions { |
15 class ExtensionMessageBubbleController; | 16 class ExtensionMessageBubbleController; |
16 } | 17 } |
17 | 18 |
18 // A bridge between an ExtensionMessageBubbleController and a | 19 // A bridge between an ExtensionMessageBubbleController and a |
19 // ToolbarActionsBarBubble. | 20 // ToolbarActionsBarBubble. |
20 class ExtensionMessageBubbleBridge : public ToolbarActionsBarBubbleDelegate { | 21 class ExtensionMessageBubbleBridge : public ToolbarActionsBarBubbleDelegate { |
21 public: | 22 public: |
22 ExtensionMessageBubbleBridge( | 23 ExtensionMessageBubbleBridge( |
23 scoped_ptr<extensions::ExtensionMessageBubbleController> controller, | 24 std::unique_ptr<extensions::ExtensionMessageBubbleController> controller, |
24 bool anchored_to_extension); | 25 bool anchored_to_extension); |
25 ~ExtensionMessageBubbleBridge() override; | 26 ~ExtensionMessageBubbleBridge() override; |
26 | 27 |
27 private: | 28 private: |
28 // ToolbarActionsBarBubbleDelegate: | 29 // ToolbarActionsBarBubbleDelegate: |
29 base::string16 GetHeadingText() override; | 30 base::string16 GetHeadingText() override; |
30 base::string16 GetBodyText() override; | 31 base::string16 GetBodyText() override; |
31 base::string16 GetItemListText() override; | 32 base::string16 GetItemListText() override; |
32 base::string16 GetActionButtonText() override; | 33 base::string16 GetActionButtonText() override; |
33 base::string16 GetDismissButtonText() override; | 34 base::string16 GetDismissButtonText() override; |
34 base::string16 GetLearnMoreButtonText() override; | 35 base::string16 GetLearnMoreButtonText() override; |
35 std::string GetAnchorActionId() override; | 36 std::string GetAnchorActionId() override; |
36 void OnBubbleShown() override; | 37 void OnBubbleShown() override; |
37 void OnBubbleClosed(CloseAction action) override; | 38 void OnBubbleClosed(CloseAction action) override; |
38 | 39 |
39 scoped_ptr<extensions::ExtensionMessageBubbleController> controller_; | 40 std::unique_ptr<extensions::ExtensionMessageBubbleController> controller_; |
40 | 41 |
41 // True if the bubble is anchored to an extension action. | 42 // True if the bubble is anchored to an extension action. |
42 bool anchored_to_extension_; | 43 bool anchored_to_extension_; |
43 | 44 |
44 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleBridge); | 45 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleBridge); |
45 }; | 46 }; |
46 | 47 |
47 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_ | 48 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_ |
OLD | NEW |