[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / frame / browser_desktop_window_tree_host_win.h
blobe504f9d8490a41a20c3ea47d49781b3b4dcc253e
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 virtual ~BrowserDesktopWindowTreeHostWin();
34 private:
35 views::NativeMenuWin* GetSystemMenu();
37 // Overridden from BrowserDesktopWindowTreeHost:
38 virtual DesktopWindowTreeHost* AsDesktopWindowTreeHost() OVERRIDE;
39 virtual int GetMinimizeButtonOffset() const OVERRIDE;
40 virtual bool UsesNativeSystemMenu() const OVERRIDE;
42 // Overridden from DesktopWindowTreeHostWin:
43 virtual int GetInitialShowState() const OVERRIDE;
44 virtual bool GetClientAreaInsets(gfx::Insets* insets) const OVERRIDE;
45 virtual void HandleCreate() OVERRIDE;
46 virtual void HandleFrameChanged() OVERRIDE;
47 virtual bool PreHandleMSG(UINT message,
48 WPARAM w_param,
49 LPARAM l_param,
50 LRESULT* result) OVERRIDE;
51 virtual void PostHandleMSG(UINT message,
52 WPARAM w_param,
53 LPARAM l_param) OVERRIDE;
54 virtual bool IsUsingCustomFrame() const OVERRIDE;
55 virtual bool ShouldUseNativeFrame() const OVERRIDE;
56 virtual void FrameTypeChanged() OVERRIDE;
58 void UpdateDWMFrame();
60 MARGINS GetDWMFrameMargins() const;
62 BrowserView* browser_view_;
63 BrowserFrame* browser_frame_;
65 MinimizeButtonMetrics minimize_button_metrics_;
67 scoped_ptr<BrowserWindowPropertyManager> browser_window_property_manager_;
69 // The wrapped system menu itself.
70 scoped_ptr<views::NativeMenuWin> system_menu_;
72 // Necessary to avoid corruption on NC paint in Aero mode.
73 bool did_gdi_clear_;
75 DISALLOW_COPY_AND_ASSIGN(BrowserDesktopWindowTreeHostWin);
79 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_WIN_H_