summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.h
blob: ab925a45f892c54d7a7023891c168f8180832d16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_
#define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_

#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h"

@class ToolbarActionsBarBubbleMac;

namespace extensions {
class ExtensionMessageBubbleController;
}

// A bridge between an ExtensionMessageBubbleController and a
// ToolbarActionsBarBubble.
class ExtensionMessageBubbleBridge : public ToolbarActionsBarBubbleDelegate {
 public:
  ExtensionMessageBubbleBridge(
      scoped_ptr<extensions::ExtensionMessageBubbleController> controller,
      bool anchored_to_extension);
  ~ExtensionMessageBubbleBridge() override;

 private:
  // ToolbarActionsBarBubbleDelegate:
  base::string16 GetHeadingText() override;
  base::string16 GetBodyText() override;
  base::string16 GetItemListText() override;
  base::string16 GetActionButtonText() override;
  base::string16 GetDismissButtonText() override;
  base::string16 GetLearnMoreButtonText() override;
  std::string GetAnchorActionId() override;
  void OnBubbleShown() override;
  void OnBubbleClosed(CloseAction action) override;

  scoped_ptr<extensions::ExtensionMessageBubbleController> controller_;

  // True if the bubble is anchored to an extension action.
  bool anchored_to_extension_;

  DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleBridge);
};

#endif  // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_BRIDGE_H_