OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_PRES ENTER_H_ | |
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_PRES ENTER_H_ | |
7 | |
8 #import <Foundation/Foundation.h> | |
9 | |
10 #include <memory> | |
11 | |
12 #include "base/macros.h" | |
13 #include "ui/views/widget/widget_observer.h" | |
14 | |
15 @class NSWindow; | |
16 | |
17 namespace test { | |
18 class ToolbarActionsBarBubbleViewsPresenterTestApi; | |
19 } | |
20 | |
21 @class BrowserActionsController; | |
22 class ToolbarActionsBarBubbleDelegate; | |
23 class ToolbarActionsBarBubbleViews; | |
24 | |
25 // Helper class for showing a toolkit-views toolbar action bubble on a Cocoa | |
26 // browser. | |
27 class ToolbarActionsBarBubbleViewsPresenter : public views::WidgetObserver { | |
28 public: | |
29 explicit ToolbarActionsBarBubbleViewsPresenter( | |
30 BrowserActionsController* owner); | |
31 ~ToolbarActionsBarBubbleViewsPresenter() override; | |
32 | |
33 // Presents |bubble| attached to the provided browser window. | |
34 void PresentAt(std::unique_ptr<ToolbarActionsBarBubbleDelegate> bubble, | |
35 NSWindow* parent_window, | |
36 NSPoint point_in_screen, | |
37 bool anchored_to_action_view); | |
Elly Fong-Jones
2017/03/08 16:33:44
what is an action view in this context?
tapted
2017/03/09 10:24:16
Updated comment:
// Presents |bubble| attached
| |
38 | |
39 private: | |
40 friend class test::ToolbarActionsBarBubbleViewsPresenterTestApi; | |
41 | |
42 // WidgetObserver: | |
43 void OnWidgetClosing(views::Widget* widget) override; | |
44 void OnWidgetDestroying(views::Widget* widget) override; | |
45 | |
46 BrowserActionsController* owner_; | |
Elly Fong-Jones
2017/03/08 16:33:45
who owns these? the views hierarchy?
tapted
2017/03/09 10:24:16
Added comments:
BrowserActionsController* owner
| |
47 ToolbarActionsBarBubbleViews* active_bubble_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViewsPresenter); | |
50 }; | |
51 | |
52 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_P RESENTER_H_ | |
OLD | NEW |