Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Side by Side Diff: ui/aura/window.h

Issue 8253001: aura: Some changes in Window and Desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/observer_list.h"
13 #include "base/string16.h" 14 #include "base/string16.h"
14 #include "ui/base/ui_base_types.h" 15 #include "ui/base/ui_base_types.h"
15 #include "ui/aura/aura_export.h" 16 #include "ui/aura/aura_export.h"
16 #include "ui/gfx/compositor/layer_delegate.h" 17 #include "ui/gfx/compositor/layer_delegate.h"
17 #include "ui/gfx/native_widget_types.h" 18 #include "ui/gfx/native_widget_types.h"
18 #include "ui/gfx/rect.h" 19 #include "ui/gfx/rect.h"
19 20
20 class SkCanvas; 21 class SkCanvas;
21 22
22 namespace ui { 23 namespace ui {
23 class Animation; 24 class Animation;
24 class Compositor; 25 class Compositor;
25 class Layer; 26 class Layer;
26 } 27 }
27 28
28 namespace aura { 29 namespace aura {
29 30
30 class Desktop; 31 class Desktop;
31 class EventFilter; 32 class EventFilter;
32 class KeyEvent; 33 class KeyEvent;
33 class LayoutManager; 34 class LayoutManager;
34 class MouseEvent; 35 class MouseEvent;
35 class ToplevelWindowContainer; 36 class ToplevelWindowContainer;
36 class WindowDelegate; 37 class WindowDelegate;
38 class WindowObserver;
37 39
38 namespace internal { 40 namespace internal {
39 class FocusManager; 41 class FocusManager;
40 class RootWindow; 42 class RootWindow;
41 } 43 }
42 44
43 // Aura window implementation. Interesting events are sent to the 45 // Aura window implementation. Interesting events are sent to the
44 // WindowDelegate. 46 // WindowDelegate.
45 // TODO(beng): resolve ownership. 47 // TODO(beng): resolve ownership.
46 class AURA_EXPORT Window : public ui::LayerDelegate { 48 class AURA_EXPORT Window : public ui::LayerDelegate {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void SetEventFilter(EventFilter* event_filter); 153 void SetEventFilter(EventFilter* event_filter);
152 154
153 // Handles a mouse event. Returns true if handled. 155 // Handles a mouse event. Returns true if handled.
154 bool OnMouseEvent(MouseEvent* event); 156 bool OnMouseEvent(MouseEvent* event);
155 157
156 // Handles a key event. Returns true if handled. 158 // Handles a key event. Returns true if handled.
157 bool OnKeyEvent(KeyEvent* event); 159 bool OnKeyEvent(KeyEvent* event);
158 160
159 WindowDelegate* delegate() { return delegate_; } 161 WindowDelegate* delegate() { return delegate_; }
160 162
163 // Add/remove observer.
164 void AddObserver(WindowObserver* observer);
165 void RemoveObserver(WindowObserver* observer);
166
161 // When set to true, this Window will stop propagation of all events targeted 167 // When set to true, this Window will stop propagation of all events targeted
162 // at Windows below it in the z-order, but only if this Window has children. 168 // at Windows below it in the z-order, but only if this Window has children.
163 // This is used to implement lock-screen type functionality where we do not 169 // This is used to implement lock-screen type functionality where we do not
164 // want events to be sent to running logged-in windows when the lock screen is 170 // want events to be sent to running logged-in windows when the lock screen is
165 // displayed. 171 // displayed.
166 void set_stops_event_propagation(bool stops_event_propagation) { 172 void set_stops_event_propagation(bool stops_event_propagation) {
167 stops_event_propagation_ = stops_event_propagation; 173 stops_event_propagation_ = stops_event_propagation;
168 } 174 }
169 175
170 // Returns true if the mouse pointer at the specified |point| can trigger an 176 // Returns true if the mouse pointer at the specified |point| can trigger an
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 262
257 scoped_ptr<EventFilter> event_filter_; 263 scoped_ptr<EventFilter> event_filter_;
258 scoped_ptr<LayoutManager> layout_manager_; 264 scoped_ptr<LayoutManager> layout_manager_;
259 265
260 void* user_data_; 266 void* user_data_;
261 267
262 // When true, events are not sent to windows behind this one in the z-order, 268 // When true, events are not sent to windows behind this one in the z-order,
263 // provided this window has children. See set_stops_event_propagation(). 269 // provided this window has children. See set_stops_event_propagation().
264 bool stops_event_propagation_; 270 bool stops_event_propagation_;
265 271
272 ObserverList<WindowObserver> observers_;
273
266 DISALLOW_COPY_AND_ASSIGN(Window); 274 DISALLOW_COPY_AND_ASSIGN(Window);
267 }; 275 };
268 276
269 } // namespace aura 277 } // namespace aura
270 278
271 #endif // UI_AURA_WINDOW_H_ 279 #endif // UI_AURA_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698