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 #if defined(__OBJC__) |
| 12 @class NativeWidgetMacNSWindow; |
| 13 #else |
| 14 class NativeWidgetMacNSWindow; |
| 15 #endif |
| 16 |
11 namespace views { | 17 namespace views { |
12 namespace test { | 18 namespace test { |
13 class HitTestNativeWidgetMac; | 19 class HitTestNativeWidgetMac; |
14 class MockNativeWidgetMac; | 20 class MockNativeWidgetMac; |
15 } | 21 } |
16 | 22 |
17 class BridgedNativeWidget; | 23 class BridgedNativeWidget; |
18 | 24 |
19 class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { | 25 class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { |
20 public: | 26 public: |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 Widget::VisibilityTransition transition) override; | 124 Widget::VisibilityTransition transition) override; |
119 ui::NativeTheme* GetNativeTheme() const override; | 125 ui::NativeTheme* GetNativeTheme() const override; |
120 void OnRootViewLayout() override; | 126 void OnRootViewLayout() override; |
121 bool IsTranslucentWindowOpacitySupported() const override; | 127 bool IsTranslucentWindowOpacitySupported() const override; |
122 void OnSizeConstraintsChanged() override; | 128 void OnSizeConstraintsChanged() override; |
123 void RepostNativeEvent(gfx::NativeEvent native_event) override; | 129 void RepostNativeEvent(gfx::NativeEvent native_event) override; |
124 | 130 |
125 protected: | 131 protected: |
126 // Creates the NSWindow that will be passed to the BridgedNativeWidget. | 132 // Creates the NSWindow that will be passed to the BridgedNativeWidget. |
127 // Called by InitNativeWidget. The return value will be autoreleased. | 133 // Called by InitNativeWidget. The return value will be autoreleased. |
128 virtual gfx::NativeWindow CreateNSWindow(const Widget::InitParams& params); | 134 virtual NativeWidgetMacNSWindow* CreateNSWindow( |
| 135 const Widget::InitParams& params); |
129 | 136 |
130 internal::NativeWidgetDelegate* delegate() { return delegate_; } | 137 internal::NativeWidgetDelegate* delegate() { return delegate_; } |
131 | 138 |
132 private: | 139 private: |
133 friend class test::MockNativeWidgetMac; | 140 friend class test::MockNativeWidgetMac; |
134 friend class test::HitTestNativeWidgetMac; | 141 friend class test::HitTestNativeWidgetMac; |
135 | 142 |
136 internal::NativeWidgetDelegate* delegate_; | 143 internal::NativeWidgetDelegate* delegate_; |
137 scoped_ptr<BridgedNativeWidget> bridge_; | 144 scoped_ptr<BridgedNativeWidget> bridge_; |
138 | 145 |
139 Widget::InitParams::Ownership ownership_; | 146 Widget::InitParams::Ownership ownership_; |
140 | 147 |
141 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMac); | 148 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMac); |
142 }; | 149 }; |
143 | 150 |
144 } // namespace views | 151 } // namespace views |
145 | 152 |
146 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ | 153 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ |
OLD | NEW |