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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/extensions/extension_message_bubble.h"
11 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h"
13 @
class ToolbarActionsBarBubbleMac
;
15 namespace extensions
{
16 class ExtensionMessageBubbleController
;
19 // A bridge between an ExtensionMessageBubbleController and a
20 // ToolbarActionsBarBubble.
21 class ExtensionMessageBubbleBridge
: public extensions::ExtensionMessageBubble
,
22 public ToolbarActionsBarBubbleDelegate
{
24 ExtensionMessageBubbleBridge(
25 scoped_ptr
<extensions::ExtensionMessageBubbleController
> controller
,
26 bool anchored_to_extension
);
27 ~ExtensionMessageBubbleBridge() override
;
29 void SetBubble(ToolbarActionsBarBubbleMac
* bubble
);
31 extensions::ExtensionMessageBubbleController
* controller() {
32 return controller_
.get();
36 // extensions::ExtensionMessageBubble:
39 // ToolbarActionsBarBubbleDelegate:
40 base::string16
GetHeadingText() override
;
41 base::string16
GetBodyText() override
;
42 base::string16
GetItemListText() override
;
43 base::string16
GetActionButtonText() override
;
44 base::string16
GetDismissButtonText() override
;
45 base::string16
GetLearnMoreButtonText() override
;
46 void OnBubbleShown() override
;
47 void OnBubbleClosed(CloseAction action
) override
;
49 scoped_ptr
<extensions::ExtensionMessageBubbleController
> controller_
;
51 // True if the bubble is anchored to an extension action.
52 bool anchored_to_extension_
;
54 ToolbarActionsBarBubbleMac
* bubble_
;
56 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleBridge
);
59 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_