| 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 COMPONENTS_MUS_WS_SERVER_WINDOW_H_ | 5 #ifndef COMPONENTS_MUS_WS_SERVER_WINDOW_H_ |
| 6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_H_ | 6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // Transient window management. | 102 // Transient window management. |
| 103 void AddTransientWindow(ServerWindow* child); | 103 void AddTransientWindow(ServerWindow* child); |
| 104 void RemoveTransientWindow(ServerWindow* child); | 104 void RemoveTransientWindow(ServerWindow* child); |
| 105 | 105 |
| 106 ServerWindow* transient_parent() { return transient_parent_; } | 106 ServerWindow* transient_parent() { return transient_parent_; } |
| 107 const ServerWindow* transient_parent() const { return transient_parent_; } | 107 const ServerWindow* transient_parent() const { return transient_parent_; } |
| 108 | 108 |
| 109 const Windows& transient_children() const { return transient_children_; } | 109 const Windows& transient_children() const { return transient_children_; } |
| 110 | 110 |
| 111 bool is_modal() const { return is_modal_; } |
| 112 void SetModal(); |
| 113 |
| 114 bool IsBlockedByModalWindow() const; |
| 115 |
| 116 // Returns the window that events targeted to this window should be retargeted |
| 117 // to; according to modal windows. If any modal window is blocking this |
| 118 // window, returns the topmost one; otherwise, returns this window. |
| 119 const ServerWindow* GetModalTarget() const; |
| 120 ServerWindow* GetModalTarget() { |
| 121 return const_cast<ServerWindow*>( |
| 122 static_cast<const ServerWindow*>(this)->GetModalTarget()); |
| 123 } |
| 124 |
| 111 // Returns true if this contains |window| or is |window|. | 125 // Returns true if this contains |window| or is |window|. |
| 112 bool Contains(const ServerWindow* window) const; | 126 bool Contains(const ServerWindow* window) const; |
| 113 | 127 |
| 114 // Returns the visibility requested by this window. IsDrawn() returns whether | 128 // Returns the visibility requested by this window. IsDrawn() returns whether |
| 115 // the window is actually visible on screen. | 129 // the window is actually visible on screen. |
| 116 bool visible() const { return visible_; } | 130 bool visible() const { return visible_; } |
| 117 void SetVisible(bool value); | 131 void SetVisible(bool value); |
| 118 | 132 |
| 119 float opacity() const { return opacity_; } | 133 float opacity() const { return opacity_; } |
| 120 void SetOpacity(float value); | 134 void SetOpacity(float value); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 ServerWindow* parent_; | 204 ServerWindow* parent_; |
| 191 Windows children_; | 205 Windows children_; |
| 192 | 206 |
| 193 // Transient window management. | 207 // Transient window management. |
| 194 // If non-null we're actively restacking transient as the result of a | 208 // If non-null we're actively restacking transient as the result of a |
| 195 // transient ancestor changing. | 209 // transient ancestor changing. |
| 196 ServerWindow* stacking_target_; | 210 ServerWindow* stacking_target_; |
| 197 ServerWindow* transient_parent_; | 211 ServerWindow* transient_parent_; |
| 198 Windows transient_children_; | 212 Windows transient_children_; |
| 199 | 213 |
| 214 bool is_modal_; |
| 200 bool visible_; | 215 bool visible_; |
| 201 gfx::Rect bounds_; | 216 gfx::Rect bounds_; |
| 202 gfx::Insets client_area_; | 217 gfx::Insets client_area_; |
| 203 std::vector<gfx::Rect> additional_client_areas_; | 218 std::vector<gfx::Rect> additional_client_areas_; |
| 204 scoped_ptr<ServerWindowSurfaceManager> surface_manager_; | 219 scoped_ptr<ServerWindowSurfaceManager> surface_manager_; |
| 205 mojom::Cursor cursor_id_; | 220 mojom::Cursor cursor_id_; |
| 206 float opacity_; | 221 float opacity_; |
| 207 bool can_focus_; | 222 bool can_focus_; |
| 208 gfx::Transform transform_; | 223 gfx::Transform transform_; |
| 209 ui::TextInputState text_input_state_; | 224 ui::TextInputState text_input_state_; |
| 210 | 225 |
| 211 Properties properties_; | 226 Properties properties_; |
| 212 | 227 |
| 213 gfx::Vector2d underlay_offset_; | 228 gfx::Vector2d underlay_offset_; |
| 214 | 229 |
| 215 // The hit test for windows extends outside the bounds of the window by this | 230 // The hit test for windows extends outside the bounds of the window by this |
| 216 // amount. | 231 // amount. |
| 217 gfx::Insets extended_hit_test_region_; | 232 gfx::Insets extended_hit_test_region_; |
| 218 | 233 |
| 219 base::ObserverList<ServerWindowObserver> observers_; | 234 base::ObserverList<ServerWindowObserver> observers_; |
| 220 | 235 |
| 221 DISALLOW_COPY_AND_ASSIGN(ServerWindow); | 236 DISALLOW_COPY_AND_ASSIGN(ServerWindow); |
| 222 }; | 237 }; |
| 223 | 238 |
| 224 } // namespace ws | 239 } // namespace ws |
| 225 } // namespace mus | 240 } // namespace mus |
| 226 | 241 |
| 227 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_H_ | 242 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_H_ |
| OLD | NEW |