| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
| 20 #include "ui/aura/aura_export.h" | 20 #include "ui/aura/aura_export.h" |
| 21 #include "ui/aura/window_observer.h" | 21 #include "ui/aura/window_observer.h" |
| 22 #include "ui/base/class_property.h" | 22 #include "ui/base/class_property.h" |
| 23 #include "ui/compositor/layer_animator.h" | 23 #include "ui/compositor/layer_animator.h" |
| 24 #include "ui/compositor/layer_delegate.h" | 24 #include "ui/compositor/layer_delegate.h" |
| 25 #include "ui/compositor/layer_owner.h" | 25 #include "ui/compositor/layer_owner.h" |
| 26 #include "ui/events/event_constants.h" | 26 #include "ui/events/event_constants.h" |
| 27 #include "ui/events/event_target.h" | 27 #include "ui/events/event_target.h" |
| 28 #include "ui/events/event_targeter.h" | 28 #include "ui/events/event_targeter.h" |
| 29 #include "ui/events/gestures/gesture_types.h" | 29 #include "ui/events/gestures/gesture_types.h" |
| 30 #include "ui/gfx/geometry/insets.h" | |
| 31 #include "ui/gfx/geometry/rect.h" | 30 #include "ui/gfx/geometry/rect.h" |
| 32 #include "ui/gfx/native_widget_types.h" | 31 #include "ui/gfx/native_widget_types.h" |
| 33 #include "ui/wm/public/window_types.h" | 32 #include "ui/wm/public/window_types.h" |
| 34 | 33 |
| 35 namespace display { | 34 namespace display { |
| 36 class Display; | 35 class Display; |
| 37 } | 36 } |
| 38 | 37 |
| 39 namespace gfx { | 38 namespace gfx { |
| 40 class Transform; | 39 class Transform; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 gfx::NativeCursor GetCursor(const gfx::Point& point) const; | 232 gfx::NativeCursor GetCursor(const gfx::Point& point) const; |
| 234 | 233 |
| 235 // Add/remove observer. | 234 // Add/remove observer. |
| 236 void AddObserver(WindowObserver* observer); | 235 void AddObserver(WindowObserver* observer); |
| 237 void RemoveObserver(WindowObserver* observer); | 236 void RemoveObserver(WindowObserver* observer); |
| 238 bool HasObserver(const WindowObserver* observer) const; | 237 bool HasObserver(const WindowObserver* observer) const; |
| 239 | 238 |
| 240 void set_ignore_events(bool ignore_events) { ignore_events_ = ignore_events; } | 239 void set_ignore_events(bool ignore_events) { ignore_events_ = ignore_events; } |
| 241 bool ignore_events() const { return ignore_events_; } | 240 bool ignore_events() const { return ignore_events_; } |
| 242 | 241 |
| 243 // Sets the window to grab hits for an area extending |insets| pixels inside | |
| 244 // its bounds (even if that inner region overlaps a child window). This can be | |
| 245 // used to create an invisible non-client area that overlaps the client area. | |
| 246 void set_hit_test_bounds_override_inner(const gfx::Insets& insets) { | |
| 247 hit_test_bounds_override_inner_ = insets; | |
| 248 } | |
| 249 gfx::Insets hit_test_bounds_override_inner() const { | |
| 250 return hit_test_bounds_override_inner_; | |
| 251 } | |
| 252 | |
| 253 // Returns true if the |point_in_root| in root window's coordinate falls | 242 // Returns true if the |point_in_root| in root window's coordinate falls |
| 254 // within this window's bounds. Returns false if the window is detached | 243 // within this window's bounds. Returns false if the window is detached |
| 255 // from root window. | 244 // from root window. |
| 256 bool ContainsPointInRoot(const gfx::Point& point_in_root) const; | 245 bool ContainsPointInRoot(const gfx::Point& point_in_root) const; |
| 257 | 246 |
| 258 // Returns true if relative-to-this-Window's-origin |local_point| falls | 247 // Returns true if relative-to-this-Window's-origin |local_point| falls |
| 259 // within this Window's bounds. | 248 // within this Window's bounds. |
| 260 bool ContainsPoint(const gfx::Point& local_point) const; | 249 bool ContainsPoint(const gfx::Point& local_point) const; |
| 261 | 250 |
| 262 // Returns the Window that most closely encloses |local_point| for the | 251 // Returns the Window that most closely encloses |local_point| for the |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 | 464 |
| 476 // Whether layer is initialized as non-opaque. Defaults to false. | 465 // Whether layer is initialized as non-opaque. Defaults to false. |
| 477 bool transparent_; | 466 bool transparent_; |
| 478 | 467 |
| 479 std::unique_ptr<LayoutManager> layout_manager_; | 468 std::unique_ptr<LayoutManager> layout_manager_; |
| 480 std::unique_ptr<ui::EventTargeter> targeter_; | 469 std::unique_ptr<ui::EventTargeter> targeter_; |
| 481 | 470 |
| 482 // Makes the window pass all events through to any windows behind it. | 471 // Makes the window pass all events through to any windows behind it. |
| 483 bool ignore_events_; | 472 bool ignore_events_; |
| 484 | 473 |
| 485 // See set_hit_test_bounds_override_inner(). | |
| 486 gfx::Insets hit_test_bounds_override_inner_; | |
| 487 | |
| 488 base::ObserverList<WindowObserver, true> observers_; | 474 base::ObserverList<WindowObserver, true> observers_; |
| 489 | 475 |
| 490 DISALLOW_COPY_AND_ASSIGN(Window); | 476 DISALLOW_COPY_AND_ASSIGN(Window); |
| 491 }; | 477 }; |
| 492 | 478 |
| 493 } // namespace aura | 479 } // namespace aura |
| 494 | 480 |
| 495 #endif // UI_AURA_WINDOW_H_ | 481 #endif // UI_AURA_WINDOW_H_ |
| OLD | NEW |