| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 namespace ui { | 46 namespace ui { |
| 47 class Layer; | 47 class Layer; |
| 48 } | 48 } |
| 49 | 49 |
| 50 namespace aura { | 50 namespace aura { |
| 51 | 51 |
| 52 class LayoutManager; | 52 class LayoutManager; |
| 53 class WindowDelegate; | 53 class WindowDelegate; |
| 54 class WindowObserver; |
| 54 class WindowPort; | 55 class WindowPort; |
| 55 class WindowObserver; | 56 class WindowPortForShutdown; |
| 56 class WindowTreeHost; | 57 class WindowTreeHost; |
| 57 | 58 |
| 58 // Defined in class_property.h (which we do not include) | 59 // Defined in class_property.h (which we do not include) |
| 59 template<typename T> | 60 template<typename T> |
| 60 using WindowProperty = ui::ClassProperty<T>; | 61 using WindowProperty = ui::ClassProperty<T>; |
| 61 | 62 |
| 62 namespace test { | 63 namespace test { |
| 63 class WindowTestApi; | 64 class WindowTestApi; |
| 64 } | 65 } |
| 65 | 66 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // Overrides from ui::PropertyHandler | 323 // Overrides from ui::PropertyHandler |
| 323 std::unique_ptr<ui::PropertyData> BeforePropertyChange(const void* key) | 324 std::unique_ptr<ui::PropertyData> BeforePropertyChange(const void* key) |
| 324 override; | 325 override; |
| 325 void AfterPropertyChange(const void* key, | 326 void AfterPropertyChange(const void* key, |
| 326 int64_t old_value, | 327 int64_t old_value, |
| 327 std::unique_ptr<ui::PropertyData> data) override; | 328 std::unique_ptr<ui::PropertyData> data) override; |
| 328 private: | 329 private: |
| 329 friend class LayoutManager; | 330 friend class LayoutManager; |
| 330 friend class PropertyConverter; | 331 friend class PropertyConverter; |
| 331 friend class WindowPort; | 332 friend class WindowPort; |
| 333 friend class WindowPortForShutdown; |
| 332 friend class WindowTargeter; | 334 friend class WindowTargeter; |
| 333 friend class test::WindowTestApi; | 335 friend class test::WindowTestApi; |
| 334 | 336 |
| 335 // Returns true if the mouse pointer at relative-to-this-Window's-origin | 337 // Returns true if the mouse pointer at relative-to-this-Window's-origin |
| 336 // |local_point| can trigger an event for this Window. | 338 // |local_point| can trigger an event for this Window. |
| 337 // TODO(beng): A Window can supply a hit-test mask to cause some portions of | 339 // TODO(beng): A Window can supply a hit-test mask to cause some portions of |
| 338 // itself to not trigger events, causing the events to fall through to the | 340 // itself to not trigger events, causing the events to fall through to the |
| 339 // Window behind. | 341 // Window behind. |
| 340 bool HitTest(const gfx::Point& local_point); | 342 bool HitTest(const gfx::Point& local_point); |
| 341 | 343 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 void ConvertEventToTarget(ui::EventTarget* target, | 435 void ConvertEventToTarget(ui::EventTarget* target, |
| 434 ui::LocatedEvent* event) override; | 436 ui::LocatedEvent* event) override; |
| 435 | 437 |
| 436 // Updates the layer name based on the window's name and id. | 438 // Updates the layer name based on the window's name and id. |
| 437 void UpdateLayerName(); | 439 void UpdateLayerName(); |
| 438 | 440 |
| 439 // Window owns its corresponding WindowPort, but the ref is held as a raw | 441 // Window owns its corresponding WindowPort, but the ref is held as a raw |
| 440 // pointer in |port_| so that it can still be accessed during destruction. | 442 // pointer in |port_| so that it can still be accessed during destruction. |
| 441 // This is important as deleting the WindowPort may result in trying to lookup | 443 // This is important as deleting the WindowPort may result in trying to lookup |
| 442 // the WindowPort associated with the Window. | 444 // the WindowPort associated with the Window. |
| 445 // |
| 446 // NOTE: this value is reset for windows that exist when WindowTreeClient |
| 447 // is deleted. |
| 443 std::unique_ptr<WindowPort> port_owner_; | 448 std::unique_ptr<WindowPort> port_owner_; |
| 444 WindowPort* port_; | 449 WindowPort* port_; |
| 445 | 450 |
| 446 // Bounds of this window relative to the parent. This is cached as the bounds | 451 // Bounds of this window relative to the parent. This is cached as the bounds |
| 447 // of the Layer and Window are not necessarily the same. In particular bounds | 452 // of the Layer and Window are not necessarily the same. In particular bounds |
| 448 // of the Layer are relative to the first ancestor with a Layer, where as this | 453 // of the Layer are relative to the first ancestor with a Layer, where as this |
| 449 // is relative to the parent Window. | 454 // is relative to the parent Window. |
| 450 gfx::Rect bounds_; | 455 gfx::Rect bounds_; |
| 451 | 456 |
| 452 WindowTreeHost* host_; | 457 WindowTreeHost* host_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 482 bool ignore_events_; | 487 bool ignore_events_; |
| 483 | 488 |
| 484 base::ObserverList<WindowObserver, true> observers_; | 489 base::ObserverList<WindowObserver, true> observers_; |
| 485 | 490 |
| 486 DISALLOW_COPY_AND_ASSIGN(Window); | 491 DISALLOW_COPY_AND_ASSIGN(Window); |
| 487 }; | 492 }; |
| 488 | 493 |
| 489 } // namespace aura | 494 } // namespace aura |
| 490 | 495 |
| 491 #endif // UI_AURA_WINDOW_H_ | 496 #endif // UI_AURA_WINDOW_H_ |
| OLD | NEW |