Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / views / frame / browser_desktop_window_tree_host_win.h
blob26f20c229bc09ce033e966a7618f24a09999bc77
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_
8 #include <windows.h>
9 #include <uxtheme.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"
15 class BrowserFrame;
16 class BrowserView;
17 class BrowserWindowPropertyManager;
19 namespace views {
20 class DesktopNativeWidgetAura;
21 class NativeMenuWin;
24 class BrowserDesktopWindowTreeHostWin : public BrowserDesktopWindowTreeHost,
25 public views::DesktopWindowTreeHostWin {
26 public:
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;
34 private:
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,
48 WPARAM w_param,
49 LPARAM l_param,
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.
71 bool did_gdi_clear_;
73 DISALLOW_COPY_AND_ASSIGN(BrowserDesktopWindowTreeHostWin);
77 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_WIN_H_