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/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/supports_user_data.h" |
10 #include "ui/aura/aura_export.h" | 11 #include "ui/aura/aura_export.h" |
11 #include "ui/events/event_handler.h" | 12 #include "ui/events/event_handler.h" |
12 #include "ui/events/event_target.h" | 13 #include "ui/events/event_target.h" |
13 #include "ui/gfx/point.h" | 14 #include "ui/gfx/point.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 class ContextFactory; | 17 class ContextFactory; |
17 class PlatformEventSource; | 18 class PlatformEventSource; |
18 } | 19 } |
19 namespace aura { | 20 namespace aura { |
20 | 21 |
21 namespace test { | 22 namespace test { |
22 class EnvTestHelper; | 23 class EnvTestHelper; |
23 } | 24 } |
24 | 25 |
25 class EnvObserver; | 26 class EnvObserver; |
26 class InputStateLookup; | 27 class InputStateLookup; |
27 class Window; | 28 class Window; |
28 class WindowTreeHost; | 29 class WindowTreeHost; |
29 | 30 |
30 // A singleton object that tracks general state within Aura. | 31 // A singleton object that tracks general state within Aura. |
31 class AURA_EXPORT Env : public ui::EventTarget { | 32 class AURA_EXPORT Env : public ui::EventTarget, public base::SupportsUserData { |
32 public: | 33 public: |
33 // Creates the single Env instance (if it hasn't been created yet). If | 34 // Creates the single Env instance (if it hasn't been created yet). If |
34 // |create_event_source| is true a PlatformEventSource is created. | 35 // |create_event_source| is true a PlatformEventSource is created. |
35 // TODO(sky): nuke |create_event_source|. Only necessary while mojo's | 36 // TODO(sky): nuke |create_event_source|. Only necessary while mojo's |
36 // nativeviewportservice lives in the same process as the viewmanager. | 37 // nativeviewportservice lives in the same process as the viewmanager. |
37 static void CreateInstance(bool create_event_source); | 38 static void CreateInstance(bool create_event_source); |
38 static Env* GetInstance(); | 39 static Env* GetInstance(); |
39 static void DeleteInstance(); | 40 static void DeleteInstance(); |
40 | 41 |
41 void AddObserver(EnvObserver* observer); | 42 void AddObserver(EnvObserver* observer); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 scoped_ptr<ui::PlatformEventSource> event_source_; | 103 scoped_ptr<ui::PlatformEventSource> event_source_; |
103 | 104 |
104 ui::ContextFactory* context_factory_; | 105 ui::ContextFactory* context_factory_; |
105 | 106 |
106 DISALLOW_COPY_AND_ASSIGN(Env); | 107 DISALLOW_COPY_AND_ASSIGN(Env); |
107 }; | 108 }; |
108 | 109 |
109 } // namespace aura | 110 } // namespace aura |
110 | 111 |
111 #endif // UI_AURA_ENV_H_ | 112 #endif // UI_AURA_ENV_H_ |
OLD | NEW |