base/threading: remove ScopedTracker placed for experiments
[chromium-blink-merge.git] / ui / platform_window / win / win_window.h
blobeb02ca94ea292d74eb5c83c945d0dac1b50b6133
1 // Copyright 2014 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 UI_PLATFORM_WINDOW_WIN_WIN_WINDOW_H_
6 #define UI_PLATFORM_WINDOW_WIN_WIN_WINDOW_H_
8 #include "base/compiler_specific.h"
9 #include "ui/gfx/win/window_impl.h"
10 #include "ui/platform_window/platform_window.h"
11 #include "ui/platform_window/win/win_window_export.h"
13 namespace ui {
15 class WIN_WINDOW_EXPORT WinWindow : public NON_EXPORTED_BASE(PlatformWindow),
16 public gfx::WindowImpl {
17 public:
18 WinWindow(PlatformWindowDelegate* delegate, const gfx::Rect& bounds);
19 ~WinWindow() override;
21 private:
22 void Destroy();
24 // PlatformWindow:
25 void Show() override;
26 void Hide() override;
27 void Close() override;
28 void SetBounds(const gfx::Rect& bounds) override;
29 gfx::Rect GetBounds() override;
30 void SetCapture() override;
31 void ReleaseCapture() override;
32 void ToggleFullscreen() override;
33 void Maximize() override;
34 void Minimize() override;
35 void Restore() override;
36 void SetCursor(PlatformCursor cursor) override;
37 void MoveCursorTo(const gfx::Point& location) override;
38 void ConfineCursorToBounds(const gfx::Rect& bounds) override;
39 PlatformImeController* GetPlatformImeController() override;
41 CR_BEGIN_MSG_MAP_EX(WinWindow)
42 CR_MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange)
43 CR_MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE,
44 WM_NCXBUTTONDBLCLK,
45 OnMouseRange)
46 CR_MESSAGE_HANDLER_EX(WM_CAPTURECHANGED, OnCaptureChanged)
48 CR_MESSAGE_HANDLER_EX(WM_KEYDOWN, OnKeyEvent)
49 CR_MESSAGE_HANDLER_EX(WM_KEYUP, OnKeyEvent)
50 CR_MESSAGE_HANDLER_EX(WM_SYSKEYDOWN, OnKeyEvent)
51 CR_MESSAGE_HANDLER_EX(WM_SYSKEYUP, OnKeyEvent)
52 CR_MESSAGE_HANDLER_EX(WM_CHAR, OnKeyEvent)
53 CR_MESSAGE_HANDLER_EX(WM_SYSCHAR, OnKeyEvent)
54 CR_MESSAGE_HANDLER_EX(WM_IME_CHAR, OnKeyEvent)
55 CR_MESSAGE_HANDLER_EX(WM_NCACTIVATE, OnNCActivate)
57 CR_MSG_WM_CLOSE(OnClose)
58 CR_MSG_WM_CREATE(OnCreate)
59 CR_MSG_WM_DESTROY(OnDestroy)
60 CR_MSG_WM_PAINT(OnPaint)
61 CR_MSG_WM_WINDOWPOSCHANGED(OnWindowPosChanged)
62 CR_END_MSG_MAP()
64 LRESULT OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param);
65 LRESULT OnCaptureChanged(UINT message, WPARAM w_param, LPARAM l_param);
66 LRESULT OnKeyEvent(UINT message, WPARAM w_param, LPARAM l_param);
67 LRESULT OnNCActivate(UINT message, WPARAM w_param, LPARAM l_param);
68 void OnClose();
69 LRESULT OnCreate(CREATESTRUCT* create_struct);
70 void OnDestroy();
71 void OnPaint(HDC);
72 void OnWindowPosChanged(WINDOWPOS* window_pos);
74 PlatformWindowDelegate* delegate_;
76 DISALLOW_COPY_AND_ASSIGN(WinWindow);
79 namespace test {
81 // Set true to let WindowTreeHostWin use a popup window
82 // with no frame/title so that the window size and test's
83 // expectations matches.
84 WIN_WINDOW_EXPORT void SetUsePopupAsRootWindowForTest(bool use);
86 } // namespace test
88 } // namespace ui
90 #endif // UI_PLATFORM_WINDOW_WIN_WIN_WINDOW_H_