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