OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 void SetEventFilter(EventFilter* event_filter); | 113 void SetEventFilter(EventFilter* event_filter); |
114 | 114 |
115 // Handles a mouse event. Returns true if handled. | 115 // Handles a mouse event. Returns true if handled. |
116 bool OnMouseEvent(MouseEvent* event); | 116 bool OnMouseEvent(MouseEvent* event); |
117 | 117 |
118 // Handles a key event. Returns true if handled. | 118 // Handles a key event. Returns true if handled. |
119 bool OnKeyEvent(KeyEvent* event); | 119 bool OnKeyEvent(KeyEvent* event); |
120 | 120 |
121 WindowDelegate* delegate() { return delegate_; } | 121 WindowDelegate* delegate() { return delegate_; } |
122 | 122 |
| 123 // When set to true, this Window will consume all events targeted at it or |
| 124 // Windows below it in the z-order, but only if this Window has children. This |
| 125 // is used to implement lock-screen type functionality where we do not want |
| 126 // events to be sent to running logged-in windows when the lock screen is |
| 127 // displayed. |
| 128 void set_consumes_events(bool consumes_events) { |
| 129 consumes_events_ = consumes_events; |
| 130 } |
| 131 |
123 // Returns true if the mouse pointer at the specified |point| can trigger an | 132 // Returns true if the mouse pointer at the specified |point| can trigger an |
124 // event for this Window. | 133 // event for this Window. |
125 // TODO(beng): | 134 // TODO(beng): |
126 // A Window can supply a hit-test mask to cause some portions of itself to not | 135 // A Window can supply a hit-test mask to cause some portions of itself to not |
127 // trigger events, causing the events to fall through to the Window behind. | 136 // trigger events, causing the events to fall through to the Window behind. |
128 bool HitTest(const gfx::Point& point); | 137 bool HitTest(const gfx::Point& point); |
129 | 138 |
130 // Returns the Window that most closely encloses |point| for the purposes of | 139 // Returns the Window that most closely encloses |point| for the purposes of |
131 // event targeting. | 140 // event targeting. |
132 Window* GetEventHandlerForPoint(const gfx::Point& point); | 141 Window* GetEventHandlerForPoint(const gfx::Point& point); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 Windows children_; | 191 Windows children_; |
183 | 192 |
184 int id_; | 193 int id_; |
185 std::string name_; | 194 std::string name_; |
186 | 195 |
187 scoped_ptr<EventFilter> event_filter_; | 196 scoped_ptr<EventFilter> event_filter_; |
188 scoped_ptr<LayoutManager> layout_manager_; | 197 scoped_ptr<LayoutManager> layout_manager_; |
189 | 198 |
190 void* user_data_; | 199 void* user_data_; |
191 | 200 |
| 201 // When true, events are not sent to windows behind this one in the z-order, |
| 202 // provided this window has children. See set_consumes_events(). |
| 203 bool consumes_events_; |
| 204 |
192 DISALLOW_COPY_AND_ASSIGN(Window); | 205 DISALLOW_COPY_AND_ASSIGN(Window); |
193 }; | 206 }; |
194 | 207 |
195 } // namespace aura | 208 } // namespace aura |
196 | 209 |
197 #endif // UI_AURA_WINDOW_H_ | 210 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |