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_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ |
7 | 7 |
8 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" | 8 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" |
9 #include "chrome/browser/ui/views/frame/browser_desktop_root_window_host.h" | 9 #include "chrome/browser/ui/views/frame/browser_desktop_root_window_host.h" |
10 #include "chrome/browser/ui/views/frame/minimize_button_metrics_win.h" | 10 #include "chrome/browser/ui/views/frame/minimize_button_metrics_win.h" |
11 | 11 |
12 class BrowserFrame; | 12 class BrowserFrame; |
13 class BrowserView; | 13 class BrowserView; |
14 | 14 |
15 namespace views { | 15 namespace views { |
16 class DesktopNativeWidgetAura; | 16 class DesktopNativeWidgetAura; |
| 17 class NativeMenuWin; |
17 } | 18 } |
18 | 19 |
19 class BrowserDesktopRootWindowHostWin : public BrowserDesktopRootWindowHost, | 20 class BrowserDesktopRootWindowHostWin : public BrowserDesktopRootWindowHost, |
20 public views::DesktopRootWindowHostWin { | 21 public views::DesktopRootWindowHostWin { |
21 public: | 22 public: |
22 BrowserDesktopRootWindowHostWin( | 23 BrowserDesktopRootWindowHostWin( |
23 views::internal::NativeWidgetDelegate* native_widget_delegate, | 24 views::internal::NativeWidgetDelegate* native_widget_delegate, |
24 views::DesktopNativeWidgetAura* desktop_native_widget_aura, | 25 views::DesktopNativeWidgetAura* desktop_native_widget_aura, |
25 const gfx::Rect& initial_bounds, | 26 const gfx::Rect& initial_bounds, |
26 BrowserView* browser_view, | 27 BrowserView* browser_view, |
27 BrowserFrame* browser_frame); | 28 BrowserFrame* browser_frame); |
28 virtual ~BrowserDesktopRootWindowHostWin(); | 29 virtual ~BrowserDesktopRootWindowHostWin(); |
29 | 30 |
30 private: | 31 private: |
| 32 views::NativeMenuWin* GetSystemMenu(); |
| 33 |
31 // Overridden from BrowserDesktopRootWindowHost: | 34 // Overridden from BrowserDesktopRootWindowHost: |
32 virtual DesktopRootWindowHost* AsDesktopRootWindowHost() OVERRIDE; | 35 virtual DesktopRootWindowHost* AsDesktopRootWindowHost() OVERRIDE; |
33 virtual int GetMinimizeButtonOffset() const OVERRIDE; | 36 virtual int GetMinimizeButtonOffset() const OVERRIDE; |
| 37 virtual bool UsesNativeSystemMenu() const OVERRIDE; |
34 | 38 |
35 // Overridden from DesktopRootWindowHostWin: | 39 // Overridden from DesktopRootWindowHostWin: |
36 virtual int GetInitialShowState() const OVERRIDE; | 40 virtual int GetInitialShowState() const OVERRIDE; |
37 virtual bool GetClientAreaInsets(gfx::Insets* insets) const OVERRIDE; | 41 virtual bool GetClientAreaInsets(gfx::Insets* insets) const OVERRIDE; |
38 virtual void HandleFrameChanged() OVERRIDE; | 42 virtual void HandleFrameChanged() OVERRIDE; |
39 virtual bool PreHandleMSG(UINT message, | 43 virtual bool PreHandleMSG(UINT message, |
40 WPARAM w_param, | 44 WPARAM w_param, |
41 LPARAM l_param, | 45 LPARAM l_param, |
42 LRESULT* result) OVERRIDE; | 46 LRESULT* result) OVERRIDE; |
43 virtual void PostHandleMSG(UINT message, | 47 virtual void PostHandleMSG(UINT message, |
44 WPARAM w_param, | 48 WPARAM w_param, |
45 LPARAM l_param) OVERRIDE; | 49 LPARAM l_param) OVERRIDE; |
46 virtual bool IsUsingCustomFrame() const OVERRIDE; | 50 virtual bool IsUsingCustomFrame() const OVERRIDE; |
47 | 51 |
48 void UpdateDWMFrame(); | 52 void UpdateDWMFrame(); |
49 | 53 |
50 BrowserView* browser_view_; | 54 BrowserView* browser_view_; |
51 BrowserFrame* browser_frame_; | 55 BrowserFrame* browser_frame_; |
52 | 56 |
53 MinimizeButtonMetrics minimize_button_metrics_; | 57 MinimizeButtonMetrics minimize_button_metrics_; |
54 | 58 |
| 59 // The wrapped system menu itself. |
| 60 scoped_ptr<views::NativeMenuWin> system_menu_; |
| 61 |
55 DISALLOW_COPY_AND_ASSIGN(BrowserDesktopRootWindowHostWin); | 62 DISALLOW_COPY_AND_ASSIGN(BrowserDesktopRootWindowHostWin); |
56 }; | 63 }; |
57 | 64 |
58 | 65 |
59 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ | 66 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ |
OLD | NEW |