| 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 SERVICES_UI_WS_SERVER_WINDOW_H_ | 5 #ifndef SERVICES_UI_WS_SERVER_WINDOW_H_ |
| 6 #define SERVICES_UI_WS_SERVER_WINDOW_H_ | 6 #define SERVICES_UI_WS_SERVER_WINDOW_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 std::string GetName() const; | 157 std::string GetName() const; |
| 158 | 158 |
| 159 void SetTextInputState(const ui::TextInputState& state); | 159 void SetTextInputState(const ui::TextInputState& state); |
| 160 const ui::TextInputState& text_input_state() const { | 160 const ui::TextInputState& text_input_state() const { |
| 161 return text_input_state_; | 161 return text_input_state_; |
| 162 } | 162 } |
| 163 | 163 |
| 164 void set_can_focus(bool can_focus) { can_focus_ = can_focus; } | 164 void set_can_focus(bool can_focus) { can_focus_ = can_focus; } |
| 165 bool can_focus() const { return can_focus_; } | 165 bool can_focus() const { return can_focus_; } |
| 166 | 166 |
| 167 void set_can_accept_events(bool value) { can_accept_events_ = value; } | 167 void set_event_targeting_policy(mojom::EventTargetingPolicy policy) { |
| 168 bool can_accept_events() const { return can_accept_events_; } | 168 event_targeting_policy_ = policy; |
| 169 } |
| 170 mojom::EventTargetingPolicy event_targeting_policy() const { |
| 171 return event_targeting_policy_; |
| 172 } |
| 169 | 173 |
| 170 // Returns true if this window is attached to a root and all ancestors are | 174 // Returns true if this window is attached to a root and all ancestors are |
| 171 // visible. | 175 // visible. |
| 172 bool IsDrawn() const; | 176 bool IsDrawn() const; |
| 173 | 177 |
| 174 const gfx::Insets& extended_hit_test_region() const { | 178 const gfx::Insets& extended_hit_test_region() const { |
| 175 return extended_hit_test_region_; | 179 return extended_hit_test_region_; |
| 176 } | 180 } |
| 177 void set_extended_hit_test_region(const gfx::Insets& insets) { | 181 void set_extended_hit_test_region(const gfx::Insets& insets) { |
| 178 extended_hit_test_region_ = insets; | 182 extended_hit_test_region_ = insets; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 bool visible_; | 242 bool visible_; |
| 239 gfx::Rect bounds_; | 243 gfx::Rect bounds_; |
| 240 gfx::Insets client_area_; | 244 gfx::Insets client_area_; |
| 241 std::vector<gfx::Rect> additional_client_areas_; | 245 std::vector<gfx::Rect> additional_client_areas_; |
| 242 std::unique_ptr<ServerWindowCompositorFrameSinkManager> | 246 std::unique_ptr<ServerWindowCompositorFrameSinkManager> |
| 243 compositor_frame_sink_manager_; | 247 compositor_frame_sink_manager_; |
| 244 mojom::Cursor cursor_id_; | 248 mojom::Cursor cursor_id_; |
| 245 mojom::Cursor non_client_cursor_id_; | 249 mojom::Cursor non_client_cursor_id_; |
| 246 float opacity_; | 250 float opacity_; |
| 247 bool can_focus_; | 251 bool can_focus_; |
| 248 bool can_accept_events_; | 252 mojom::EventTargetingPolicy event_targeting_policy_ = |
| 253 mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS; |
| 249 gfx::Transform transform_; | 254 gfx::Transform transform_; |
| 250 ui::TextInputState text_input_state_; | 255 ui::TextInputState text_input_state_; |
| 251 | 256 |
| 252 Properties properties_; | 257 Properties properties_; |
| 253 | 258 |
| 254 gfx::Vector2d underlay_offset_; | 259 gfx::Vector2d underlay_offset_; |
| 255 | 260 |
| 256 // The hit test for windows extends outside the bounds of the window by this | 261 // The hit test for windows extends outside the bounds of the window by this |
| 257 // amount. | 262 // amount. |
| 258 gfx::Insets extended_hit_test_region_; | 263 gfx::Insets extended_hit_test_region_; |
| 259 | 264 |
| 260 // Mouse events outside the hit test mask don't hit the window. An empty mask | 265 // Mouse events outside the hit test mask don't hit the window. An empty mask |
| 261 // means all events miss the window. If null there is no mask. | 266 // means all events miss the window. If null there is no mask. |
| 262 std::unique_ptr<gfx::Rect> hit_test_mask_; | 267 std::unique_ptr<gfx::Rect> hit_test_mask_; |
| 263 | 268 |
| 264 // Whether this window can be the target in a drag and drop | 269 // Whether this window can be the target in a drag and drop |
| 265 // operation. Clients must opt-in to this. | 270 // operation. Clients must opt-in to this. |
| 266 bool accepts_drops_ = false; | 271 bool accepts_drops_ = false; |
| 267 | 272 |
| 268 base::ObserverList<ServerWindowObserver> observers_; | 273 base::ObserverList<ServerWindowObserver> observers_; |
| 269 | 274 |
| 270 DISALLOW_COPY_AND_ASSIGN(ServerWindow); | 275 DISALLOW_COPY_AND_ASSIGN(ServerWindow); |
| 271 }; | 276 }; |
| 272 | 277 |
| 273 } // namespace ws | 278 } // namespace ws |
| 274 } // namespace ui | 279 } // namespace ui |
| 275 | 280 |
| 276 #endif // SERVICES_UI_WS_SERVER_WINDOW_H_ | 281 #endif // SERVICES_UI_WS_SERVER_WINDOW_H_ |
| OLD | NEW |