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