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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "base/supports_user_data.h" | 12 #include "base/supports_user_data.h" |
13 #include "ui/aura/aura_export.h" | 13 #include "ui/aura/aura_export.h" |
14 #include "ui/events/event_handler.h" | 14 #include "ui/events/event_handler.h" |
15 #include "ui/events/event_target.h" | 15 #include "ui/events/event_target.h" |
16 #include "ui/gfx/geometry/point.h" | 16 #include "ui/gfx/geometry/point.h" |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 class ContextFactory; | 19 class ContextFactory; |
| 20 class ContextFactoryPrivate; |
20 class PlatformEventSource; | 21 class PlatformEventSource; |
21 } | 22 } |
22 namespace aura { | 23 namespace aura { |
23 | 24 |
24 namespace client { | 25 namespace client { |
25 class FocusClient; | 26 class FocusClient; |
26 } | 27 } |
27 | 28 |
28 namespace test { | 29 namespace test { |
29 class EnvTestHelper; | 30 class EnvTestHelper; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 81 |
81 // Whether any touch device is currently down. | 82 // Whether any touch device is currently down. |
82 bool is_touch_down() const { return is_touch_down_; } | 83 bool is_touch_down() const { return is_touch_down_; } |
83 void set_touch_down(bool value) { is_touch_down_ = value; } | 84 void set_touch_down(bool value) { is_touch_down_ = value; } |
84 | 85 |
85 void set_context_factory(ui::ContextFactory* context_factory) { | 86 void set_context_factory(ui::ContextFactory* context_factory) { |
86 context_factory_ = context_factory; | 87 context_factory_ = context_factory; |
87 } | 88 } |
88 ui::ContextFactory* context_factory() { return context_factory_; } | 89 ui::ContextFactory* context_factory() { return context_factory_; } |
89 | 90 |
| 91 void set_context_factory_private( |
| 92 ui::ContextFactoryPrivate* context_factory_private) { |
| 93 context_factory_private_ = context_factory_private; |
| 94 } |
| 95 ui::ContextFactoryPrivate* context_factory_private() { |
| 96 return context_factory_private_; |
| 97 } |
| 98 |
90 // See CreateInstance() for description. | 99 // See CreateInstance() for description. |
91 void SetWindowTreeClient(WindowTreeClient* window_tree_client); | 100 void SetWindowTreeClient(WindowTreeClient* window_tree_client); |
92 bool HasWindowTreeClient() const { return window_tree_client_ != nullptr; } | 101 bool HasWindowTreeClient() const { return window_tree_client_ != nullptr; } |
93 | 102 |
94 // Sets the active FocusClient and the window the FocusClient is associated | 103 // Sets the active FocusClient and the window the FocusClient is associated |
95 // with. |window| is not necessarily the window that actually has focus. | 104 // with. |window| is not necessarily the window that actually has focus. |
96 // |window| may be null, which indicates all windows share a FocusClient. | 105 // |window| may be null, which indicates all windows share a FocusClient. |
97 void SetActiveFocusClient(client::FocusClient* focus_client, | 106 void SetActiveFocusClient(client::FocusClient* focus_client, |
98 Window* focus_client_root); | 107 Window* focus_client_root); |
99 client::FocusClient* active_focus_client() { return active_focus_client_; } | 108 client::FocusClient* active_focus_client() { return active_focus_client_; } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 145 |
137 int mouse_button_flags_; | 146 int mouse_button_flags_; |
138 // Location of last mouse event, in screen coordinates. | 147 // Location of last mouse event, in screen coordinates. |
139 gfx::Point last_mouse_location_; | 148 gfx::Point last_mouse_location_; |
140 bool is_touch_down_; | 149 bool is_touch_down_; |
141 | 150 |
142 std::unique_ptr<InputStateLookup> input_state_lookup_; | 151 std::unique_ptr<InputStateLookup> input_state_lookup_; |
143 std::unique_ptr<ui::PlatformEventSource> event_source_; | 152 std::unique_ptr<ui::PlatformEventSource> event_source_; |
144 | 153 |
145 ui::ContextFactory* context_factory_; | 154 ui::ContextFactory* context_factory_; |
| 155 ui::ContextFactoryPrivate* context_factory_private_; |
146 | 156 |
147 Window* active_focus_client_root_ = nullptr; | 157 Window* active_focus_client_root_ = nullptr; |
148 client::FocusClient* active_focus_client_ = nullptr; | 158 client::FocusClient* active_focus_client_ = nullptr; |
149 std::unique_ptr<ActiveFocusClientWindowObserver> | 159 std::unique_ptr<ActiveFocusClientWindowObserver> |
150 active_focus_client_window_observer_; | 160 active_focus_client_window_observer_; |
151 | 161 |
152 DISALLOW_COPY_AND_ASSIGN(Env); | 162 DISALLOW_COPY_AND_ASSIGN(Env); |
153 }; | 163 }; |
154 | 164 |
155 } // namespace aura | 165 } // namespace aura |
156 | 166 |
157 #endif // UI_AURA_ENV_H_ | 167 #endif // UI_AURA_ENV_H_ |
OLD | NEW |