| 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/base/events/event_handler.h" | 13 #include "ui/base/events/event_handler.h" |
| 14 #include "ui/base/events/event_target.h" | 14 #include "ui/base/events/event_target.h" |
| 15 #include "ui/gfx/point.h" | 15 #include "ui/gfx/point.h" |
| 16 | 16 |
| 17 #if defined(USE_X11) | 17 #if defined(USE_X11) |
| 18 #include "ui/aura/device_list_updater_aurax11.h" | 18 #include "ui/aura/device_list_updater_aurax11.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 namespace aura { | 21 namespace aura { |
| 22 class EnvObserver; | 22 class EnvObserver; |
| 23 class EventFilter; | 23 class EventFilter; |
| 24 class DisplayManager; | |
| 25 class Window; | 24 class Window; |
| 26 | 25 |
| 27 namespace internal { | |
| 28 class DisplayChangeObserverX11; | |
| 29 } | |
| 30 | |
| 31 #if !defined(USE_X11) | 26 #if !defined(USE_X11) |
| 32 // Creates a platform-specific native event dispatcher. | 27 // Creates a platform-specific native event dispatcher. |
| 33 MessageLoop::Dispatcher* CreateDispatcher(); | 28 MessageLoop::Dispatcher* CreateDispatcher(); |
| 34 #endif | 29 #endif |
| 35 | 30 |
| 36 // A singleton object that tracks general state within Aura. | 31 // A singleton object that tracks general state within Aura. |
| 37 // TODO(beng): manage RootWindows. | 32 // TODO(beng): manage RootWindows. |
| 38 class AURA_EXPORT Env : public ui::EventTarget { | 33 class AURA_EXPORT Env : public ui::EventTarget { |
| 39 public: | 34 public: |
| 40 Env(); | 35 Env(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 70 // In some cases when page is using transparent background painting white | 65 // In some cases when page is using transparent background painting white |
| 71 // background before backing store is initialized causes a white splash. | 66 // background before backing store is initialized causes a white splash. |
| 72 bool render_white_bg() const { return render_white_bg_; } | 67 bool render_white_bg() const { return render_white_bg_; } |
| 73 void set_render_white_bg(bool value) { render_white_bg_ = value; } | 68 void set_render_white_bg(bool value) { render_white_bg_ = value; } |
| 74 | 69 |
| 75 client::StackingClient* stacking_client() { return stacking_client_; } | 70 client::StackingClient* stacking_client() { return stacking_client_; } |
| 76 void set_stacking_client(client::StackingClient* stacking_client) { | 71 void set_stacking_client(client::StackingClient* stacking_client) { |
| 77 stacking_client_ = stacking_client; | 72 stacking_client_ = stacking_client; |
| 78 } | 73 } |
| 79 | 74 |
| 80 // Gets/sets DisplayManager. The DisplayManager's ownership is | |
| 81 // transfered. | |
| 82 DisplayManager* display_manager() { return display_manager_.get(); } | |
| 83 void SetDisplayManager(DisplayManager* display_manager); | |
| 84 | |
| 85 // Returns the native event dispatcher. The result should only be passed to | 75 // Returns the native event dispatcher. The result should only be passed to |
| 86 // base::RunLoop(dispatcher), or used to dispatch an event by | 76 // base::RunLoop(dispatcher), or used to dispatch an event by |
| 87 // |Dispatch(const NativeEvent&)| on it. It must never be stored. | 77 // |Dispatch(const NativeEvent&)| on it. It must never be stored. |
| 88 #if !defined(OS_MACOSX) | 78 #if !defined(OS_MACOSX) |
| 89 MessageLoop::Dispatcher* GetDispatcher(); | 79 MessageLoop::Dispatcher* GetDispatcher(); |
| 90 #endif | 80 #endif |
| 91 | 81 |
| 92 private: | 82 private: |
| 93 friend class Window; | 83 friend class Window; |
| 94 | 84 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 109 static Env* instance_; | 99 static Env* instance_; |
| 110 int mouse_button_flags_; | 100 int mouse_button_flags_; |
| 111 // Location of last mouse event, in screen coordinates. | 101 // Location of last mouse event, in screen coordinates. |
| 112 gfx::Point last_mouse_location_; | 102 gfx::Point last_mouse_location_; |
| 113 // If the cursor is hidden, saves the previous last_mouse_position. | 103 // If the cursor is hidden, saves the previous last_mouse_position. |
| 114 gfx::Point hidden_cursor_location_; | 104 gfx::Point hidden_cursor_location_; |
| 115 bool is_cursor_hidden_; | 105 bool is_cursor_hidden_; |
| 116 bool is_touch_down_; | 106 bool is_touch_down_; |
| 117 bool render_white_bg_; | 107 bool render_white_bg_; |
| 118 client::StackingClient* stacking_client_; | 108 client::StackingClient* stacking_client_; |
| 119 scoped_ptr<DisplayManager> display_manager_; | |
| 120 | 109 |
| 121 #if defined(USE_X11) | 110 #if defined(USE_X11) |
| 122 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_; | |
| 123 DeviceListUpdaterAuraX11 device_list_updater_aurax11_; | 111 DeviceListUpdaterAuraX11 device_list_updater_aurax11_; |
| 124 #endif | 112 #endif |
| 125 | 113 |
| 126 DISALLOW_COPY_AND_ASSIGN(Env); | 114 DISALLOW_COPY_AND_ASSIGN(Env); |
| 127 }; | 115 }; |
| 128 | 116 |
| 129 } // namespace aura | 117 } // namespace aura |
| 130 | 118 |
| 131 #endif // UI_AURA_ENV_H_ | 119 #endif // UI_AURA_ENV_H_ |
| OLD | NEW |