| 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_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 5 #ifndef UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
| 6 #define UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 6 #define UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void OnFullscreenTransitionStart(bool target_fullscreen_state); | 58 void OnFullscreenTransitionStart(bool target_fullscreen_state); |
| 59 | 59 |
| 60 // Called when a fullscreen transition completes. If target_fullscreen_state() | 60 // Called when a fullscreen transition completes. If target_fullscreen_state() |
| 61 // does not match |actual_fullscreen_state|, a new transition will begin. | 61 // does not match |actual_fullscreen_state|, a new transition will begin. |
| 62 void OnFullscreenTransitionComplete(bool actual_fullscreen_state); | 62 void OnFullscreenTransitionComplete(bool actual_fullscreen_state); |
| 63 | 63 |
| 64 // Transition the window into or out of fullscreen. This will immediately | 64 // Transition the window into or out of fullscreen. This will immediately |
| 65 // invert the value of target_fullscreen_state(). | 65 // invert the value of target_fullscreen_state(). |
| 66 void ToggleDesiredFullscreenState(); | 66 void ToggleDesiredFullscreenState(); |
| 67 | 67 |
| 68 // Called by the NSWindowDelegate when the visibility of the window may have |
| 69 // changed. For example, due to a (de)miniaturize operation, or the window |
| 70 // being reordered in (or out of) the screen list. |
| 71 void OnVisibilityChanged(); |
| 72 |
| 68 // See widget.h for documentation. | 73 // See widget.h for documentation. |
| 69 InputMethod* CreateInputMethod(); | 74 InputMethod* CreateInputMethod(); |
| 70 ui::InputMethod* GetHostInputMethod(); | 75 ui::InputMethod* GetHostInputMethod(); |
| 71 | 76 |
| 72 // The restored bounds will be derived from the current NSWindow frame unless | 77 // The restored bounds will be derived from the current NSWindow frame unless |
| 73 // fullscreen or transitioning between fullscreen states. | 78 // fullscreen or transitioning between fullscreen states. |
| 74 gfx::Rect GetRestoredBounds() const; | 79 gfx::Rect GetRestoredBounds() const; |
| 75 | 80 |
| 76 NativeWidgetMac* native_widget_mac() { return native_widget_mac_; } | 81 NativeWidgetMac* native_widget_mac() { return native_widget_mac_; } |
| 77 BridgedContentView* ns_view() { return bridged_view_; } | 82 BridgedContentView* ns_view() { return bridged_view_; } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 99 gfx::Rect bounds_before_fullscreen_; | 104 gfx::Rect bounds_before_fullscreen_; |
| 100 | 105 |
| 101 // Whether this window wants to be fullscreen. If a fullscreen animation is in | 106 // Whether this window wants to be fullscreen. If a fullscreen animation is in |
| 102 // progress then it might not be actually fullscreen. | 107 // progress then it might not be actually fullscreen. |
| 103 bool target_fullscreen_state_; | 108 bool target_fullscreen_state_; |
| 104 | 109 |
| 105 // Whether this window is in a fullscreen transition, and the fullscreen state | 110 // Whether this window is in a fullscreen transition, and the fullscreen state |
| 106 // can not currently be changed. | 111 // can not currently be changed. |
| 107 bool in_fullscreen_transition_; | 112 bool in_fullscreen_transition_; |
| 108 | 113 |
| 114 // Stores the value last read from -[NSWindow isVisible], to detect visibility |
| 115 // changes. |
| 116 bool window_visible_; |
| 117 |
| 109 // Overridden from FocusChangeListener: | 118 // Overridden from FocusChangeListener: |
| 110 virtual void OnWillChangeFocus(View* focused_before, | 119 virtual void OnWillChangeFocus(View* focused_before, |
| 111 View* focused_now) override; | 120 View* focused_now) override; |
| 112 virtual void OnDidChangeFocus(View* focused_before, | 121 virtual void OnDidChangeFocus(View* focused_before, |
| 113 View* focused_now) override; | 122 View* focused_now) override; |
| 114 | 123 |
| 115 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); | 124 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); |
| 116 }; | 125 }; |
| 117 | 126 |
| 118 } // namespace views | 127 } // namespace views |
| 119 | 128 |
| 120 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 129 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
| OLD | NEW |