OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/views/frame/native_browser_frame.h" | 10 #include "chrome/browser/ui/views/frame/native_browser_frame.h" |
11 #include "ui/views/context_menu_controller.h" | |
12 #include "ui/views/widget/native_widget_aura.h" | 11 #include "ui/views/widget/native_widget_aura.h" |
13 | 12 |
14 class BrowserFrame; | 13 class BrowserFrame; |
15 class BrowserView; | 14 class BrowserView; |
16 | 15 |
17 namespace views { | |
18 class MenuRunner; | |
19 } | |
20 | |
21 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
22 // BrowserFrameAura | 17 // BrowserFrameAura |
23 // | 18 // |
24 // BrowserFrameAura is a NativeWidgetAura subclass that provides the window | 19 // BrowserFrameAura is a NativeWidgetAura subclass that provides the window |
25 // frame for the Chrome browser window. | 20 // frame for the Chrome browser window. |
26 // | 21 // |
27 class BrowserFrameAura : public views::ContextMenuController, | 22 class BrowserFrameAura : public views::NativeWidgetAura, |
28 public views::NativeWidgetAura, | |
29 public NativeBrowserFrame { | 23 public NativeBrowserFrame { |
30 public: | 24 public: |
31 BrowserFrameAura(BrowserFrame* browser_frame, BrowserView* browser_view); | 25 BrowserFrameAura(BrowserFrame* browser_frame, BrowserView* browser_view); |
32 | 26 |
33 BrowserView* browser_view() const { return browser_view_; } | 27 BrowserView* browser_view() const { return browser_view_; } |
34 | 28 |
35 protected: | 29 protected: |
36 // Overridden from views::ContextMenuController: | |
37 virtual void ShowContextMenuForView(views::View* source, | |
38 const gfx::Point& p) OVERRIDE; | |
39 | |
40 // Overridden from views::NativeWidgetAura: | 30 // Overridden from views::NativeWidgetAura: |
41 virtual void OnWindowDestroying() OVERRIDE; | 31 virtual void OnWindowDestroying() OVERRIDE; |
42 virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE; | 32 virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE; |
43 | 33 |
44 // Overridden from NativeBrowserFrame: | 34 // Overridden from NativeBrowserFrame: |
45 virtual views::NativeWidget* AsNativeWidget() OVERRIDE; | 35 virtual views::NativeWidget* AsNativeWidget() OVERRIDE; |
46 virtual const views::NativeWidget* AsNativeWidget() const OVERRIDE; | 36 virtual const views::NativeWidget* AsNativeWidget() const OVERRIDE; |
47 virtual void InitSystemContextMenu() OVERRIDE; | 37 virtual bool UsesNativeSystemMenu() const OVERRIDE; |
48 virtual int GetMinimizeButtonOffset() const OVERRIDE; | 38 virtual int GetMinimizeButtonOffset() const OVERRIDE; |
49 virtual void TabStripDisplayModeChanged() OVERRIDE; | 39 virtual void TabStripDisplayModeChanged() OVERRIDE; |
50 | 40 |
51 private: | 41 private: |
52 class WindowPropertyWatcher; | 42 class WindowPropertyWatcher; |
53 | 43 |
54 virtual ~BrowserFrameAura(); | 44 virtual ~BrowserFrameAura(); |
55 | 45 |
56 // Set the window into the auto managed mode. | 46 // Set the window into the auto managed mode. |
57 void SetWindowAutoManaged(); | 47 void SetWindowAutoManaged(); |
58 | 48 |
59 // The BrowserView is our ClientView. This is a pointer to it. | 49 // The BrowserView is our ClientView. This is a pointer to it. |
60 BrowserView* browser_view_; | 50 BrowserView* browser_view_; |
61 | 51 |
62 scoped_ptr<WindowPropertyWatcher> window_property_watcher_; | 52 scoped_ptr<WindowPropertyWatcher> window_property_watcher_; |
63 | 53 |
64 // System menu. | |
65 scoped_ptr<views::MenuRunner> menu_runner_; | |
66 | |
67 DISALLOW_COPY_AND_ASSIGN(BrowserFrameAura); | 54 DISALLOW_COPY_AND_ASSIGN(BrowserFrameAura); |
68 }; | 55 }; |
69 | 56 |
70 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_ | 57 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_AURA_H_ |
OLD | NEW |