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_ENV_H_ | 5 #ifndef UI_AURA_ENV_H_ |
6 #define UI_AURA_ENV_H_ | 6 #define UI_AURA_ENV_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "ui/aura/aura_export.h" | 11 #include "ui/aura/aura_export.h" |
12 #include "ui/aura/cursor_manager.h" | |
13 #include "ui/aura/client/stacking_client.h" | 12 #include "ui/aura/client/stacking_client.h" |
14 | 13 |
15 namespace aura { | 14 namespace aura { |
16 class CursorManager; | |
17 class EnvObserver; | 15 class EnvObserver; |
18 class EventFilter; | 16 class EventFilter; |
19 class DisplayManager; | 17 class DisplayManager; |
20 class Window; | 18 class Window; |
21 | 19 |
22 namespace internal { | 20 namespace internal { |
23 class DisplayChangeObserverX11; | 21 class DisplayChangeObserverX11; |
24 } | 22 } |
25 | 23 |
26 #if !defined(OS_MACOSX) | 24 #if !defined(OS_MACOSX) |
(...skipping 30 matching lines...) Expand all Loading... |
57 | 55 |
58 // Gets/sets DisplayManager. The DisplayManager's ownership is | 56 // Gets/sets DisplayManager. The DisplayManager's ownership is |
59 // transfered. | 57 // transfered. |
60 DisplayManager* display_manager() { return display_manager_.get(); } | 58 DisplayManager* display_manager() { return display_manager_.get(); } |
61 void SetDisplayManager(DisplayManager* display_manager); | 59 void SetDisplayManager(DisplayManager* display_manager); |
62 | 60 |
63 // Env takes ownership of the EventFilter. | 61 // Env takes ownership of the EventFilter. |
64 EventFilter* event_filter() { return event_filter_.get(); } | 62 EventFilter* event_filter() { return event_filter_.get(); } |
65 void SetEventFilter(EventFilter* event_filter); | 63 void SetEventFilter(EventFilter* event_filter); |
66 | 64 |
67 CursorManager* cursor_manager() { return &cursor_manager_; } | |
68 | |
69 // Returns the native event dispatcher. The result should only be passed to | 65 // Returns the native event dispatcher. The result should only be passed to |
70 // base::RunLoop(dispatcher), or used to dispatch an event by | 66 // base::RunLoop(dispatcher), or used to dispatch an event by |
71 // |Dispatch(const NativeEvent&)| on it. It must never be stored. | 67 // |Dispatch(const NativeEvent&)| on it. It must never be stored. |
72 #if !defined(OS_MACOSX) | 68 #if !defined(OS_MACOSX) |
73 MessageLoop::Dispatcher* GetDispatcher(); | 69 MessageLoop::Dispatcher* GetDispatcher(); |
74 #endif | 70 #endif |
75 | 71 |
76 private: | 72 private: |
77 friend class Window; | 73 friend class Window; |
78 | 74 |
79 void Init(); | 75 void Init(); |
80 | 76 |
81 // Called by the Window when it is initialized. Notifies observers. | 77 // Called by the Window when it is initialized. Notifies observers. |
82 void NotifyWindowInitialized(Window* window); | 78 void NotifyWindowInitialized(Window* window); |
83 | 79 |
84 ObserverList<EnvObserver> observers_; | 80 ObserverList<EnvObserver> observers_; |
85 #if !defined(OS_MACOSX) | 81 #if !defined(OS_MACOSX) |
86 scoped_ptr<MessageLoop::Dispatcher> dispatcher_; | 82 scoped_ptr<MessageLoop::Dispatcher> dispatcher_; |
87 #endif | 83 #endif |
88 | 84 |
89 static Env* instance_; | 85 static Env* instance_; |
90 int mouse_button_flags_; | 86 int mouse_button_flags_; |
91 bool is_touch_down_; | 87 bool is_touch_down_; |
92 client::StackingClient* stacking_client_; | 88 client::StackingClient* stacking_client_; |
93 scoped_ptr<DisplayManager> display_manager_; | 89 scoped_ptr<DisplayManager> display_manager_; |
94 scoped_ptr<EventFilter> event_filter_; | 90 scoped_ptr<EventFilter> event_filter_; |
95 CursorManager cursor_manager_; | |
96 | 91 |
97 #if defined(USE_X11) | 92 #if defined(USE_X11) |
98 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_; | 93 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_; |
99 #endif | 94 #endif |
100 | 95 |
101 DISALLOW_COPY_AND_ASSIGN(Env); | 96 DISALLOW_COPY_AND_ASSIGN(Env); |
102 }; | 97 }; |
103 | 98 |
104 } // namespace aura | 99 } // namespace aura |
105 | 100 |
106 #endif // UI_AURA_ENV_H_ | 101 #endif // UI_AURA_ENV_H_ |
OLD | NEW |