| 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/client/stacking_client.h" | 12 #include "ui/aura/client/stacking_client.h" |
| 13 #include "ui/gfx/point.h" | 13 #include "ui/gfx/point.h" |
| 14 | 14 |
| 15 #if defined(USE_X11) | 15 #if defined(USE_X11) |
| 16 #include "ui/aura/device_list_updater_aurax11.h" | 16 #include "ui/aura/device_list_updater_aurax11.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 namespace aura { | 19 namespace aura { |
| 20 class EnvObserver; | 20 class EnvObserver; |
| 21 class EventFilter; | 21 class EventFilter; |
| 22 class DisplayManager; | 22 class DisplayManager; |
| 23 class Window; | 23 class Window; |
| 24 | 24 |
| 25 namespace internal { | 25 namespace internal { |
| 26 class DisplayChangeObserverX11; | 26 class DisplayChangeObserverX11; |
| 27 } | 27 } |
| 28 | 28 |
| 29 #if !defined(OS_MACOSX) | 29 #if !defined(USE_X11) |
| 30 // Creates a platform-specific native event dispatcher. | 30 // Creates a platform-specific native event dispatcher. |
| 31 MessageLoop::Dispatcher* CreateDispatcher(); | 31 MessageLoop::Dispatcher* CreateDispatcher(); |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 // A singleton object that tracks general state within Aura. | 34 // A singleton object that tracks general state within Aura. |
| 35 // TODO(beng): manage RootWindows. | 35 // TODO(beng): manage RootWindows. |
| 36 class AURA_EXPORT Env { | 36 class AURA_EXPORT Env { |
| 37 public: | 37 public: |
| 38 Env(); | 38 Env(); |
| 39 ~Env(); | 39 ~Env(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 friend class Window; | 95 friend class Window; |
| 96 | 96 |
| 97 void Init(); | 97 void Init(); |
| 98 | 98 |
| 99 // Called by the Window when it is initialized. Notifies observers. | 99 // Called by the Window when it is initialized. Notifies observers. |
| 100 void NotifyWindowInitialized(Window* window); | 100 void NotifyWindowInitialized(Window* window); |
| 101 | 101 |
| 102 ObserverList<EnvObserver> observers_; | 102 ObserverList<EnvObserver> observers_; |
| 103 #if defined(OS_WIN) | 103 #if !defined(USE_X11) |
| 104 scoped_ptr<MessageLoop::Dispatcher> dispatcher_; | 104 scoped_ptr<MessageLoop::Dispatcher> dispatcher_; |
| 105 #endif | 105 #endif |
| 106 | 106 |
| 107 static Env* instance_; | 107 static Env* instance_; |
| 108 int mouse_button_flags_; | 108 int mouse_button_flags_; |
| 109 // Location of last mouse event, in screen coordinates. | 109 // Location of last mouse event, in screen coordinates. |
| 110 gfx::Point last_mouse_location_; | 110 gfx::Point last_mouse_location_; |
| 111 // If the cursor is hidden, saves the previous last_mouse_position. | 111 // If the cursor is hidden, saves the previous last_mouse_position. |
| 112 gfx::Point hidden_cursor_location_; | 112 gfx::Point hidden_cursor_location_; |
| 113 bool is_cursor_hidden_; | 113 bool is_cursor_hidden_; |
| 114 bool is_touch_down_; | 114 bool is_touch_down_; |
| 115 bool render_white_bg_; | 115 bool render_white_bg_; |
| 116 client::StackingClient* stacking_client_; | 116 client::StackingClient* stacking_client_; |
| 117 scoped_ptr<DisplayManager> display_manager_; | 117 scoped_ptr<DisplayManager> display_manager_; |
| 118 scoped_ptr<EventFilter> event_filter_; | 118 scoped_ptr<EventFilter> event_filter_; |
| 119 | 119 |
| 120 #if defined(USE_X11) | 120 #if defined(USE_X11) |
| 121 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_; | 121 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_; |
| 122 DeviceListUpdaterAuraX11 device_list_updater_aurax11_; | 122 DeviceListUpdaterAuraX11 device_list_updater_aurax11_; |
| 123 #endif | 123 #endif |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(Env); | 125 DISALLOW_COPY_AND_ASSIGN(Env); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace aura | 128 } // namespace aura |
| 129 | 129 |
| 130 #endif // UI_AURA_ENV_H_ | 130 #endif // UI_AURA_ENV_H_ |
| OLD | NEW |