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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_WIN_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_WIN_H_
11 #include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host.h"
12 #include "chrome/browser/ui/views/frame/minimize_button_metrics_win.h"
13 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
17 class BrowserWindowPropertyManager
;
20 class DesktopNativeWidgetAura
;
24 class BrowserDesktopWindowTreeHostWin
: public BrowserDesktopWindowTreeHost
,
25 public views::DesktopWindowTreeHostWin
{
27 BrowserDesktopWindowTreeHostWin(
28 views::internal::NativeWidgetDelegate
* native_widget_delegate
,
29 views::DesktopNativeWidgetAura
* desktop_native_widget_aura
,
30 BrowserView
* browser_view
,
31 BrowserFrame
* browser_frame
);
32 ~BrowserDesktopWindowTreeHostWin() override
;
35 views::NativeMenuWin
* GetSystemMenu();
37 // Overridden from BrowserDesktopWindowTreeHost:
38 DesktopWindowTreeHost
* AsDesktopWindowTreeHost() override
;
39 int GetMinimizeButtonOffset() const override
;
40 bool UsesNativeSystemMenu() const override
;
42 // Overridden from DesktopWindowTreeHostWin:
43 int GetInitialShowState() const override
;
44 bool GetClientAreaInsets(gfx::Insets
* insets
) const override
;
45 void HandleCreate() override
;
46 void HandleFrameChanged() override
;
47 bool PreHandleMSG(UINT message
,
50 LRESULT
* result
) override
;
51 void PostHandleMSG(UINT message
, WPARAM w_param
, LPARAM l_param
) override
;
52 bool IsUsingCustomFrame() const override
;
53 bool ShouldUseNativeFrame() const override
;
54 void FrameTypeChanged() override
;
56 void UpdateDWMFrame();
58 MARGINS
GetDWMFrameMargins() const;
60 BrowserView
* browser_view_
;
61 BrowserFrame
* browser_frame_
;
63 MinimizeButtonMetrics minimize_button_metrics_
;
65 scoped_ptr
<BrowserWindowPropertyManager
> browser_window_property_manager_
;
67 // The wrapped system menu itself.
68 scoped_ptr
<views::NativeMenuWin
> system_menu_
;
70 // Necessary to avoid corruption on NC paint in Aero mode.
73 DISALLOW_COPY_AND_ASSIGN(BrowserDesktopWindowTreeHostWin
);
77 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_WIN_H_