Index: chrome/browser/ui/views/frame/browser_frame.h |
diff --git a/chrome/browser/ui/views/frame/browser_frame.h b/chrome/browser/ui/views/frame/browser_frame.h |
index 3983f549d7c2e17bb1d2540d45122f2ad9083481..8e77cc856eded29a98ccd744e01abf5fd58ce69e 100644 |
--- a/chrome/browser/ui/views/frame/browser_frame.h |
+++ b/chrome/browser/ui/views/frame/browser_frame.h |
@@ -9,6 +9,7 @@ |
#include "base/logging.h" |
#include "build/build_config.h" |
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
+#include "ui/views/context_menu_controller.h" |
#include "ui/views/widget/widget.h" |
class AvatarMenuButton; |
@@ -16,6 +17,7 @@ class BrowserRootView; |
class BrowserView; |
class NativeBrowserFrame; |
class NonClientFrameView; |
+class SystemMenuModelBuilder; |
namespace gfx { |
class Font; |
@@ -23,15 +25,19 @@ class Rect; |
} |
namespace ui { |
+class MenuModel; |
class ThemeProvider; |
} |
namespace views { |
+class MenuRunner; |
class View; |
} |
// This is a virtual interface that allows system specific browser frames. |
-class BrowserFrame : public views::Widget { |
+class BrowserFrame |
+ : public views::Widget, |
+ public views::ContextMenuController { |
public: |
explicit BrowserFrame(BrowserView* browser_view); |
virtual ~BrowserFrame(); |
@@ -76,6 +82,10 @@ class BrowserFrame : public views::Widget { |
virtual ui::ThemeProvider* GetThemeProvider() const OVERRIDE; |
virtual void OnNativeWidgetActivationChanged(bool active) OVERRIDE; |
+ // Overridden from views::ContextMenuController: |
+ virtual void ShowContextMenuForView(views::View* source, |
+ const gfx::Point& p) OVERRIDE; |
+ |
// Returns true if we should leave any offset at the frame caption. Typically |
// when the frame is maximized/full screen we want to leave no offset at the |
// top. |
@@ -83,6 +93,9 @@ class BrowserFrame : public views::Widget { |
AvatarMenuButton* GetAvatarMenuButton(); |
+ // Returns the menu model. BrowserFrame owns the returned model. |
+ ui::MenuModel* GetSystemMenuModel(); |
+ |
private: |
NativeBrowserFrame* native_browser_frame_; |
@@ -97,6 +110,12 @@ class BrowserFrame : public views::Widget { |
// The BrowserView is our ClientView. This is a pointer to it. |
BrowserView* browser_view_; |
+ scoped_ptr<SystemMenuModelBuilder> menu_model_builder_; |
+ |
+ // Used to show the system menu. Only used if |
+ // NativeBrowserFrame::UsesNativeSystemMenu() returns false. |
+ scoped_ptr<views::MenuRunner> menu_runner_; |
+ |
DISALLOW_COPY_AND_ASSIGN(BrowserFrame); |
}; |