OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AURA_WINDOW_H_ | 5 #ifndef UI_AURA_WINDOW_H_ |
6 #define UI_AURA_WINDOW_H_ | 6 #define UI_AURA_WINDOW_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 void SetEventFilter(EventFilter* event_filter); | 229 void SetEventFilter(EventFilter* event_filter); |
230 EventFilter* event_filter() { return event_filter_.get(); } | 230 EventFilter* event_filter() { return event_filter_.get(); } |
231 | 231 |
232 // Add/remove observer. | 232 // Add/remove observer. |
233 void AddObserver(WindowObserver* observer); | 233 void AddObserver(WindowObserver* observer); |
234 void RemoveObserver(WindowObserver* observer); | 234 void RemoveObserver(WindowObserver* observer); |
235 | 235 |
236 void set_ignore_events(bool ignore_events) { ignore_events_ = ignore_events; } | 236 void set_ignore_events(bool ignore_events) { ignore_events_ = ignore_events; } |
237 | 237 |
238 // Sets the window to grab hits for an area extending -|insets| pixels outside | 238 // Sets the window to grab hits for an area extending -|insets| pixels outside |
239 // its bounds. This can be used to create an invisible non- client area, for | 239 // its bounds. This can be used to create an invisible non-client area, for |
240 // example if your windows have no visible frames but still need to have | 240 // example if your windows have no visible frames but still need to have |
241 // resize edges. | 241 // resize edges. It is possible to set a larger hit-region for touch-events. |
242 void set_hit_test_bounds_override_outer(const gfx::Insets& insets) { | 242 void SetHitTestBoundsOverrideOuter(const gfx::Insets& mouse_insets, |
243 hit_test_bounds_override_outer_ = insets; | 243 int touch_scale) { |
| 244 hit_test_bounds_override_outer_mouse_ = mouse_insets; |
| 245 hit_test_bounds_override_outer_touch_ = mouse_insets.Scale(touch_scale); |
244 } | 246 } |
245 gfx::Insets hit_test_bounds_override_outer() const { | 247 |
246 return hit_test_bounds_override_outer_; | 248 gfx::Insets hit_test_bounds_override_outer_mouse() const { |
| 249 return hit_test_bounds_override_outer_mouse_; |
247 } | 250 } |
248 | 251 |
249 // Sets the window to grab hits for an area extending |insets| pixels inside | 252 // Sets the window to grab hits for an area extending |insets| pixels inside |
250 // its bounds (even if that inner region overlaps a child window). This can be | 253 // its bounds (even if that inner region overlaps a child window). This can be |
251 // used to create an invisible non-client area that overlaps the client area. | 254 // used to create an invisible non-client area that overlaps the client area. |
252 void set_hit_test_bounds_override_inner(const gfx::Insets& insets) { | 255 void set_hit_test_bounds_override_inner(const gfx::Insets& insets) { |
253 hit_test_bounds_override_inner_ = insets; | 256 hit_test_bounds_override_inner_ = insets; |
254 } | 257 } |
255 gfx::Insets hit_test_bounds_override_inner() const { | 258 gfx::Insets hit_test_bounds_override_inner() const { |
256 return hit_test_bounds_override_inner_; | 259 return hit_test_bounds_override_inner_; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 460 |
458 scoped_ptr<EventFilter> event_filter_; | 461 scoped_ptr<EventFilter> event_filter_; |
459 scoped_ptr<LayoutManager> layout_manager_; | 462 scoped_ptr<LayoutManager> layout_manager_; |
460 | 463 |
461 void* user_data_; | 464 void* user_data_; |
462 | 465 |
463 // Makes the window pass all events through to any windows behind it. | 466 // Makes the window pass all events through to any windows behind it. |
464 bool ignore_events_; | 467 bool ignore_events_; |
465 | 468 |
466 // See set_hit_test_outer_override(). | 469 // See set_hit_test_outer_override(). |
467 gfx::Insets hit_test_bounds_override_outer_; | 470 gfx::Insets hit_test_bounds_override_outer_mouse_; |
| 471 gfx::Insets hit_test_bounds_override_outer_touch_; |
468 gfx::Insets hit_test_bounds_override_inner_; | 472 gfx::Insets hit_test_bounds_override_inner_; |
469 | 473 |
470 ObserverList<WindowObserver> observers_; | 474 ObserverList<WindowObserver> observers_; |
471 | 475 |
472 // Value struct to keep the name and deallocator for this property. | 476 // Value struct to keep the name and deallocator for this property. |
473 // Key cannot be used for this purpose because it can be char* or | 477 // Key cannot be used for this purpose because it can be char* or |
474 // WindowProperty<>. | 478 // WindowProperty<>. |
475 struct Value { | 479 struct Value { |
476 const char* name; | 480 const char* name; |
477 intptr_t value; | 481 intptr_t value; |
478 PropertyDeallocator deallocator; | 482 PropertyDeallocator deallocator; |
479 }; | 483 }; |
480 | 484 |
481 std::map<const void*, Value> prop_map_; | 485 std::map<const void*, Value> prop_map_; |
482 | 486 |
483 DISALLOW_COPY_AND_ASSIGN(Window); | 487 DISALLOW_COPY_AND_ASSIGN(Window); |
484 }; | 488 }; |
485 | 489 |
486 } // namespace aura | 490 } // namespace aura |
487 | 491 |
488 #endif // UI_AURA_WINDOW_H_ | 492 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |