OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ | 5 #ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ |
6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ | 6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ |
7 | 7 |
8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
9 #include "ui/views/widget/native_widget_private.h" | 9 #include "ui/views/widget/native_widget_private.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 namespace test { | 12 namespace test { |
13 class MockNativeWidgetMac; | 13 class MockNativeWidgetMac; |
14 } | 14 } |
15 | 15 |
16 class BridgedNativeWidget; | 16 class BridgedNativeWidget; |
17 | 17 |
18 class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { | 18 class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { |
19 public: | 19 public: |
20 NativeWidgetMac(internal::NativeWidgetDelegate* delegate); | 20 NativeWidgetMac(internal::NativeWidgetDelegate* delegate); |
21 virtual ~NativeWidgetMac(); | 21 virtual ~NativeWidgetMac(); |
22 | 22 |
23 // Deletes |bridge_| and informs |delegate_| that the native widget is | 23 // Deletes |bridge_| and informs |delegate_| that the native widget is |
24 // destroyed. | 24 // destroyed. |
25 void OnWindowWillClose(); | 25 void OnWindowWillClose(); |
26 | 26 |
27 // internal::NativeWidgetPrivate: | 27 // internal::NativeWidgetPrivate: |
28 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; | 28 virtual void InitNativeWidget(const Widget::InitParams& params) override; |
29 virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; | 29 virtual NonClientFrameView* CreateNonClientFrameView() override; |
30 virtual bool ShouldUseNativeFrame() const OVERRIDE; | 30 virtual bool ShouldUseNativeFrame() const override; |
31 virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE; | 31 virtual bool ShouldWindowContentsBeTransparent() const override; |
32 virtual void FrameTypeChanged() OVERRIDE; | 32 virtual void FrameTypeChanged() override; |
33 virtual Widget* GetWidget() OVERRIDE; | 33 virtual Widget* GetWidget() override; |
34 virtual const Widget* GetWidget() const OVERRIDE; | 34 virtual const Widget* GetWidget() const override; |
35 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 35 virtual gfx::NativeView GetNativeView() const override; |
36 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; | 36 virtual gfx::NativeWindow GetNativeWindow() const override; |
37 virtual Widget* GetTopLevelWidget() OVERRIDE; | 37 virtual Widget* GetTopLevelWidget() override; |
38 virtual const ui::Compositor* GetCompositor() const OVERRIDE; | 38 virtual const ui::Compositor* GetCompositor() const override; |
39 virtual ui::Compositor* GetCompositor() OVERRIDE; | 39 virtual ui::Compositor* GetCompositor() override; |
40 virtual ui::Layer* GetLayer() OVERRIDE; | 40 virtual ui::Layer* GetLayer() override; |
41 virtual void ReorderNativeViews() OVERRIDE; | 41 virtual void ReorderNativeViews() override; |
42 virtual void ViewRemoved(View* view) OVERRIDE; | 42 virtual void ViewRemoved(View* view) override; |
43 virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; | 43 virtual void SetNativeWindowProperty(const char* name, void* value) override; |
44 virtual void* GetNativeWindowProperty(const char* name) const OVERRIDE; | 44 virtual void* GetNativeWindowProperty(const char* name) const override; |
45 virtual TooltipManager* GetTooltipManager() const OVERRIDE; | 45 virtual TooltipManager* GetTooltipManager() const override; |
46 virtual void SetCapture() OVERRIDE; | 46 virtual void SetCapture() override; |
47 virtual void ReleaseCapture() OVERRIDE; | 47 virtual void ReleaseCapture() override; |
48 virtual bool HasCapture() const OVERRIDE; | 48 virtual bool HasCapture() const override; |
49 virtual InputMethod* CreateInputMethod() OVERRIDE; | 49 virtual InputMethod* CreateInputMethod() override; |
50 virtual internal::InputMethodDelegate* GetInputMethodDelegate() OVERRIDE; | 50 virtual internal::InputMethodDelegate* GetInputMethodDelegate() override; |
51 virtual ui::InputMethod* GetHostInputMethod() OVERRIDE; | 51 virtual ui::InputMethod* GetHostInputMethod() override; |
52 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; | 52 virtual void CenterWindow(const gfx::Size& size) override; |
53 virtual void GetWindowPlacement( | 53 virtual void GetWindowPlacement( |
54 gfx::Rect* bounds, | 54 gfx::Rect* bounds, |
55 ui::WindowShowState* maximized) const OVERRIDE; | 55 ui::WindowShowState* maximized) const override; |
56 virtual bool SetWindowTitle(const base::string16& title) OVERRIDE; | 56 virtual bool SetWindowTitle(const base::string16& title) override; |
57 virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, | 57 virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, |
58 const gfx::ImageSkia& app_icon) OVERRIDE; | 58 const gfx::ImageSkia& app_icon) override; |
59 virtual void InitModalType(ui::ModalType modal_type) OVERRIDE; | 59 virtual void InitModalType(ui::ModalType modal_type) override; |
60 virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE; | 60 virtual gfx::Rect GetWindowBoundsInScreen() const override; |
61 virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE; | 61 virtual gfx::Rect GetClientAreaBoundsInScreen() const override; |
62 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 62 virtual gfx::Rect GetRestoredBounds() const override; |
63 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 63 virtual void SetBounds(const gfx::Rect& bounds) override; |
64 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 64 virtual void SetSize(const gfx::Size& size) override; |
65 virtual void StackAbove(gfx::NativeView native_view) OVERRIDE; | 65 virtual void StackAbove(gfx::NativeView native_view) override; |
66 virtual void StackAtTop() OVERRIDE; | 66 virtual void StackAtTop() override; |
67 virtual void StackBelow(gfx::NativeView native_view) OVERRIDE; | 67 virtual void StackBelow(gfx::NativeView native_view) override; |
68 virtual void SetShape(gfx::NativeRegion shape) OVERRIDE; | 68 virtual void SetShape(gfx::NativeRegion shape) override; |
69 virtual void Close() OVERRIDE; | 69 virtual void Close() override; |
70 virtual void CloseNow() OVERRIDE; | 70 virtual void CloseNow() override; |
71 virtual void Show() OVERRIDE; | 71 virtual void Show() override; |
72 virtual void Hide() OVERRIDE; | 72 virtual void Hide() override; |
73 virtual void ShowMaximizedWithBounds( | 73 virtual void ShowMaximizedWithBounds( |
74 const gfx::Rect& restored_bounds) OVERRIDE; | 74 const gfx::Rect& restored_bounds) override; |
75 virtual void ShowWithWindowState(ui::WindowShowState state) OVERRIDE; | 75 virtual void ShowWithWindowState(ui::WindowShowState state) override; |
76 virtual bool IsVisible() const OVERRIDE; | 76 virtual bool IsVisible() const override; |
77 virtual void Activate() OVERRIDE; | 77 virtual void Activate() override; |
78 virtual void Deactivate() OVERRIDE; | 78 virtual void Deactivate() override; |
79 virtual bool IsActive() const OVERRIDE; | 79 virtual bool IsActive() const override; |
80 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; | 80 virtual void SetAlwaysOnTop(bool always_on_top) override; |
81 virtual bool IsAlwaysOnTop() const OVERRIDE; | 81 virtual bool IsAlwaysOnTop() const override; |
82 virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE; | 82 virtual void SetVisibleOnAllWorkspaces(bool always_visible) override; |
83 virtual void Maximize() OVERRIDE; | 83 virtual void Maximize() override; |
84 virtual void Minimize() OVERRIDE; | 84 virtual void Minimize() override; |
85 virtual bool IsMaximized() const OVERRIDE; | 85 virtual bool IsMaximized() const override; |
86 virtual bool IsMinimized() const OVERRIDE; | 86 virtual bool IsMinimized() const override; |
87 virtual void Restore() OVERRIDE; | 87 virtual void Restore() override; |
88 virtual void SetFullscreen(bool fullscreen) OVERRIDE; | 88 virtual void SetFullscreen(bool fullscreen) override; |
89 virtual bool IsFullscreen() const OVERRIDE; | 89 virtual bool IsFullscreen() const override; |
90 virtual void SetOpacity(unsigned char opacity) OVERRIDE; | 90 virtual void SetOpacity(unsigned char opacity) override; |
91 virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE; | 91 virtual void SetUseDragFrame(bool use_drag_frame) override; |
92 virtual void FlashFrame(bool flash_frame) OVERRIDE; | 92 virtual void FlashFrame(bool flash_frame) override; |
93 virtual void RunShellDrag(View* view, | 93 virtual void RunShellDrag(View* view, |
94 const ui::OSExchangeData& data, | 94 const ui::OSExchangeData& data, |
95 const gfx::Point& location, | 95 const gfx::Point& location, |
96 int operation, | 96 int operation, |
97 ui::DragDropTypes::DragEventSource source) OVERRIDE; | 97 ui::DragDropTypes::DragEventSource source) override; |
98 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; | 98 virtual void SchedulePaintInRect(const gfx::Rect& rect) override; |
99 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 99 virtual void SetCursor(gfx::NativeCursor cursor) override; |
100 virtual bool IsMouseEventsEnabled() const OVERRIDE; | 100 virtual bool IsMouseEventsEnabled() const override; |
101 virtual void ClearNativeFocus() OVERRIDE; | 101 virtual void ClearNativeFocus() override; |
102 virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE; | 102 virtual gfx::Rect GetWorkAreaBoundsInScreen() const override; |
103 virtual Widget::MoveLoopResult RunMoveLoop( | 103 virtual Widget::MoveLoopResult RunMoveLoop( |
104 const gfx::Vector2d& drag_offset, | 104 const gfx::Vector2d& drag_offset, |
105 Widget::MoveLoopSource source, | 105 Widget::MoveLoopSource source, |
106 Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE; | 106 Widget::MoveLoopEscapeBehavior escape_behavior) override; |
107 virtual void EndMoveLoop() OVERRIDE; | 107 virtual void EndMoveLoop() override; |
108 virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE; | 108 virtual void SetVisibilityChangedAnimationsEnabled(bool value) override; |
109 virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE; | 109 virtual ui::NativeTheme* GetNativeTheme() const override; |
110 virtual void OnRootViewLayout() OVERRIDE; | 110 virtual void OnRootViewLayout() override; |
111 virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE; | 111 virtual bool IsTranslucentWindowOpacitySupported() const override; |
112 virtual void OnSizeConstraintsChanged() OVERRIDE; | 112 virtual void OnSizeConstraintsChanged() override; |
113 virtual void RepostNativeEvent(gfx::NativeEvent native_event) OVERRIDE; | 113 virtual void RepostNativeEvent(gfx::NativeEvent native_event) override; |
114 | 114 |
115 protected: | 115 protected: |
116 internal::NativeWidgetDelegate* delegate() { return delegate_; } | 116 internal::NativeWidgetDelegate* delegate() { return delegate_; } |
117 | 117 |
118 private: | 118 private: |
119 friend class test::MockNativeWidgetMac; | 119 friend class test::MockNativeWidgetMac; |
120 | 120 |
121 internal::NativeWidgetDelegate* delegate_; | 121 internal::NativeWidgetDelegate* delegate_; |
122 scoped_ptr<BridgedNativeWidget> bridge_; | 122 scoped_ptr<BridgedNativeWidget> bridge_; |
123 | 123 |
124 Widget::InitParams::Ownership ownership_; | 124 Widget::InitParams::Ownership ownership_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMac); | 126 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMac); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace views | 129 } // namespace views |
130 | 130 |
131 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ | 131 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ |
OLD | NEW |