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/base/dragdrop/os_exchange_data_provider_factory.h" |
14 #include "ui/events/event_handler.h" | 15 #include "ui/events/event_handler.h" |
15 #include "ui/events/event_target.h" | 16 #include "ui/events/event_target.h" |
16 #include "ui/gfx/geometry/point.h" | 17 #include "ui/gfx/geometry/point.h" |
17 | 18 |
18 namespace ui { | 19 namespace ui { |
19 class ContextFactory; | 20 class ContextFactory; |
20 class ContextFactoryPrivate; | 21 class ContextFactoryPrivate; |
21 class PlatformEventSource; | 22 class PlatformEventSource; |
22 } | 23 } |
23 namespace aura { | 24 namespace aura { |
24 | 25 |
25 namespace client { | 26 namespace client { |
26 class FocusClient; | 27 class FocusClient; |
27 } | 28 } |
28 | 29 |
29 namespace test { | 30 namespace test { |
30 class EnvTestHelper; | 31 class EnvTestHelper; |
31 } | 32 } |
32 | 33 |
33 class EnvObserver; | 34 class EnvObserver; |
34 class InputStateLookup; | 35 class InputStateLookup; |
35 class MusMouseLocationUpdater; | 36 class MusMouseLocationUpdater; |
36 class Window; | 37 class Window; |
37 class WindowPort; | 38 class WindowPort; |
38 class WindowTreeClient; | 39 class WindowTreeClient; |
39 class WindowTreeHost; | 40 class WindowTreeHost; |
40 | 41 |
41 // A singleton object that tracks general state within Aura. | 42 // A singleton object that tracks general state within Aura. |
42 class AURA_EXPORT Env : public ui::EventTarget, public base::SupportsUserData { | 43 class AURA_EXPORT Env : public ui::EventTarget, |
| 44 public ui::OSExchangeDataProviderFactory::Factory, |
| 45 public base::SupportsUserData { |
43 public: | 46 public: |
44 enum class Mode { | 47 enum class Mode { |
45 // Classic aura. | 48 // Classic aura. |
46 LOCAL, | 49 LOCAL, |
47 | 50 |
48 // Aura with a backend of mus. | 51 // Aura with a backend of mus. |
49 MUS, | 52 MUS, |
50 }; | 53 }; |
51 | 54 |
52 ~Env() override; | 55 ~Env() override; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void NotifyHostActivated(WindowTreeHost* host); | 134 void NotifyHostActivated(WindowTreeHost* host); |
132 | 135 |
133 void OnActiveFocusClientWindowDestroying(); | 136 void OnActiveFocusClientWindowDestroying(); |
134 | 137 |
135 // Overridden from ui::EventTarget: | 138 // Overridden from ui::EventTarget: |
136 bool CanAcceptEvent(const ui::Event& event) override; | 139 bool CanAcceptEvent(const ui::Event& event) override; |
137 ui::EventTarget* GetParentTarget() override; | 140 ui::EventTarget* GetParentTarget() override; |
138 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override; | 141 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override; |
139 ui::EventTargeter* GetEventTargeter() override; | 142 ui::EventTargeter* GetEventTargeter() override; |
140 | 143 |
| 144 // Overridden from ui::OSExchangeDataProviderFactory::Factory: |
| 145 std::unique_ptr<ui::OSExchangeData::Provider> BuildProvider() override; |
| 146 |
141 // This is not const for tests, which may share Env across tests and so needs | 147 // This is not const for tests, which may share Env across tests and so needs |
142 // to reset the value. | 148 // to reset the value. |
143 Mode mode_; | 149 Mode mode_; |
144 WindowTreeClient* window_tree_client_ = nullptr; | 150 WindowTreeClient* window_tree_client_ = nullptr; |
145 | 151 |
146 base::ObserverList<EnvObserver> observers_; | 152 base::ObserverList<EnvObserver> observers_; |
147 | 153 |
148 int mouse_button_flags_; | 154 int mouse_button_flags_; |
149 // Location of last mouse event, in screen coordinates. | 155 // Location of last mouse event, in screen coordinates. |
150 mutable gfx::Point last_mouse_location_; | 156 mutable gfx::Point last_mouse_location_; |
(...skipping 13 matching lines...) Expand all Loading... |
164 client::FocusClient* active_focus_client_ = nullptr; | 170 client::FocusClient* active_focus_client_ = nullptr; |
165 std::unique_ptr<ActiveFocusClientWindowObserver> | 171 std::unique_ptr<ActiveFocusClientWindowObserver> |
166 active_focus_client_window_observer_; | 172 active_focus_client_window_observer_; |
167 | 173 |
168 DISALLOW_COPY_AND_ASSIGN(Env); | 174 DISALLOW_COPY_AND_ASSIGN(Env); |
169 }; | 175 }; |
170 | 176 |
171 } // namespace aura | 177 } // namespace aura |
172 | 178 |
173 #endif // UI_AURA_ENV_H_ | 179 #endif // UI_AURA_ENV_H_ |
OLD | NEW |