Index: chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_views_presenter.h |
diff --git a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_views_presenter.h b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_views_presenter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4ddeb7255e0f40dc3a765a6612001d46518ed9be |
--- /dev/null |
+++ b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_views_presenter.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2017 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_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_PRESENTER_H_ |
+#define CHROME_BROWSER_UI_COCOA_EXTENSIONS_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_PRESENTER_H_ |
+ |
+#import <Foundation/Foundation.h> |
+ |
+#include <memory> |
+ |
+#include "base/macros.h" |
+#include "ui/views/widget/widget_observer.h" |
+ |
+@class NSWindow; |
+ |
+namespace test { |
+class ToolbarActionsBarBubbleViewsPresenterTestApi; |
+} |
+ |
+@class BrowserActionsController; |
+class ToolbarActionsBarBubbleDelegate; |
+class ToolbarActionsBarBubbleViews; |
+ |
+// Helper class for showing a toolkit-views toolbar action bubble on a Cocoa |
+// browser. |
+class ToolbarActionsBarBubbleViewsPresenter : public views::WidgetObserver { |
+ public: |
+ explicit ToolbarActionsBarBubbleViewsPresenter( |
+ BrowserActionsController* owner); |
+ ~ToolbarActionsBarBubbleViewsPresenter() override; |
+ |
+ // Presents |bubble| attached to the provided browser window. |
+ void PresentAt(std::unique_ptr<ToolbarActionsBarBubbleDelegate> bubble, |
+ NSWindow* parent_window, |
+ NSPoint point_in_screen, |
+ 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
|
+ |
+ private: |
+ friend class test::ToolbarActionsBarBubbleViewsPresenterTestApi; |
+ |
+ // WidgetObserver: |
+ void OnWidgetClosing(views::Widget* widget) override; |
+ void OnWidgetDestroying(views::Widget* widget) override; |
+ |
+ 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
|
+ ToolbarActionsBarBubbleViews* active_bubble_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViewsPresenter); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_TOOLBAR_ACTIONS_BAR_BUBBLE_VIEWS_PRESENTER_H_ |