| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/views/widget/native_widget_private.h" | 10 #include "ui/views/widget/native_widget_private.h" |
| 11 | 11 |
| 12 #if defined(__OBJC__) | 12 #if defined(__OBJC__) |
| 13 @class NativeWidgetMacNSWindow; | 13 @class NativeWidgetMacNSWindow; |
| 14 #else | 14 #else |
| 15 class NativeWidgetMacNSWindow; | 15 class NativeWidgetMacNSWindow; |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 namespace test { | 19 namespace test { |
| 20 class HitTestNativeWidgetMac; | 20 class HitTestNativeWidgetMac; |
| 21 class MockNativeWidgetMac; | 21 class MockNativeWidgetMac; |
| 22 } | 22 } |
| 23 | 23 |
| 24 class BridgedNativeWidget; | 24 class BridgedNativeWidget; |
| 25 | 25 |
| 26 class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { | 26 class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { |
| 27 public: | 27 public: |
| 28 NativeWidgetMac(internal::NativeWidgetDelegate* delegate); | 28 explicit NativeWidgetMac(internal::NativeWidgetDelegate* delegate); |
| 29 ~NativeWidgetMac() override; | 29 ~NativeWidgetMac() override; |
| 30 | 30 |
| 31 // Retrieves the bridge associated with the given NSWindow. Returns null if | 31 // Retrieves the bridge associated with the given NSWindow. Returns null if |
| 32 // the supplied handle has no associated Widget. | 32 // the supplied handle has no associated Widget. |
| 33 static BridgedNativeWidget* GetBridgeForNativeWindow( | 33 static BridgedNativeWidget* GetBridgeForNativeWindow( |
| 34 gfx::NativeWindow window); | 34 gfx::NativeWindow window); |
| 35 | 35 |
| 36 // Return true if the delegate's modal type is window-modal. These display as | 36 // Return true if the delegate's modal type is window-modal. These display as |
| 37 // a native window "sheet", and have a different lifetime to regular windows. | 37 // a native window "sheet", and have a different lifetime to regular windows. |
| 38 bool IsWindowModalSheet() const; | 38 bool IsWindowModalSheet() const; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void InitModalType(ui::ModalType modal_type) override; | 77 void InitModalType(ui::ModalType modal_type) override; |
| 78 gfx::Rect GetWindowBoundsInScreen() const override; | 78 gfx::Rect GetWindowBoundsInScreen() const override; |
| 79 gfx::Rect GetClientAreaBoundsInScreen() const override; | 79 gfx::Rect GetClientAreaBoundsInScreen() const override; |
| 80 gfx::Rect GetRestoredBounds() const override; | 80 gfx::Rect GetRestoredBounds() const override; |
| 81 std::string GetWorkspace() const override; | 81 std::string GetWorkspace() const override; |
| 82 void SetBounds(const gfx::Rect& bounds) override; | 82 void SetBounds(const gfx::Rect& bounds) override; |
| 83 void SetSize(const gfx::Size& size) override; | 83 void SetSize(const gfx::Size& size) override; |
| 84 void StackAbove(gfx::NativeView native_view) override; | 84 void StackAbove(gfx::NativeView native_view) override; |
| 85 void StackAtTop() override; | 85 void StackAtTop() override; |
| 86 void StackBelow(gfx::NativeView native_view) override; | 86 void StackBelow(gfx::NativeView native_view) override; |
| 87 void SetShape(SkRegion* shape) override; | 87 void SetShape(std::unique_ptr<SkRegion> shape) override; |
| 88 void Close() override; | 88 void Close() override; |
| 89 void CloseNow() override; | 89 void CloseNow() override; |
| 90 void Show() override; | 90 void Show() override; |
| 91 void Hide() override; | 91 void Hide() override; |
| 92 void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; | 92 void ShowMaximizedWithBounds(const gfx::Rect& restored_bounds) override; |
| 93 void ShowWithWindowState(ui::WindowShowState state) override; | 93 void ShowWithWindowState(ui::WindowShowState state) override; |
| 94 bool IsVisible() const override; | 94 bool IsVisible() const override; |
| 95 void Activate() override; | 95 void Activate() override; |
| 96 void Deactivate() override; | 96 void Deactivate() override; |
| 97 bool IsActive() const override; | 97 bool IsActive() const override; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 // Internal name. | 154 // Internal name. |
| 155 std::string name_; | 155 std::string name_; |
| 156 | 156 |
| 157 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMac); | 157 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMac); |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace views | 160 } // namespace views |
| 161 | 161 |
| 162 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ | 162 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ |
| OLD | NEW |