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" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 class EnvObserver; | 28 class EnvObserver; |
29 class InputStateLookup; | 29 class InputStateLookup; |
30 class Window; | 30 class Window; |
31 class WindowTreeHost; | 31 class WindowTreeHost; |
32 | 32 |
33 // A singleton object that tracks general state within Aura. | 33 // A singleton object that tracks general state within Aura. |
34 class AURA_EXPORT Env : public ui::EventTarget, public base::SupportsUserData { | 34 class AURA_EXPORT Env : public ui::EventTarget, public base::SupportsUserData { |
35 public: | 35 public: |
36 ~Env() override; | 36 ~Env() override; |
37 | 37 |
38 static std::unique_ptr<Env> CreateInstance(); | 38 static std::unique_ptr<Env> CreateInstance(bool running_inside_mus = false, |
rjkroege
2016/09/12 20:39:12
Why are you plumbing this?
fwang
2016/09/13 13:49:19
This is not essential here, but currently ui/aura/
| |
39 bool in_process_gpu = false); | |
39 static Env* GetInstance(); | 40 static Env* GetInstance(); |
40 static Env* GetInstanceDontCreate(); | 41 static Env* GetInstanceDontCreate(); |
41 | 42 |
42 void AddObserver(EnvObserver* observer); | 43 void AddObserver(EnvObserver* observer); |
43 void RemoveObserver(EnvObserver* observer); | 44 void RemoveObserver(EnvObserver* observer); |
44 | 45 |
45 int mouse_button_flags() const { return mouse_button_flags_; } | 46 int mouse_button_flags() const { return mouse_button_flags_; } |
46 void set_mouse_button_flags(int mouse_button_flags) { | 47 void set_mouse_button_flags(int mouse_button_flags) { |
47 mouse_button_flags_ = mouse_button_flags; | 48 mouse_button_flags_ = mouse_button_flags; |
48 } | 49 } |
(...skipping 17 matching lines...) Expand all Loading... | |
66 } | 67 } |
67 ui::ContextFactory* context_factory() { return context_factory_; } | 68 ui::ContextFactory* context_factory() { return context_factory_; } |
68 | 69 |
69 private: | 70 private: |
70 friend class test::EnvTestHelper; | 71 friend class test::EnvTestHelper; |
71 friend class Window; | 72 friend class Window; |
72 friend class WindowTreeHost; | 73 friend class WindowTreeHost; |
73 | 74 |
74 Env(); | 75 Env(); |
75 | 76 |
76 void Init(); | 77 void Init(bool running_inside_mus, bool single_process); |
77 | 78 |
78 // Called by the Window when it is initialized. Notifies observers. | 79 // Called by the Window when it is initialized. Notifies observers. |
79 void NotifyWindowInitialized(Window* window); | 80 void NotifyWindowInitialized(Window* window); |
80 | 81 |
81 // Called by the WindowTreeHost when it is initialized. Notifies observers. | 82 // Called by the WindowTreeHost when it is initialized. Notifies observers. |
82 void NotifyHostInitialized(WindowTreeHost* host); | 83 void NotifyHostInitialized(WindowTreeHost* host); |
83 | 84 |
84 // Invoked by WindowTreeHost when it is activated. Notifies observers. | 85 // Invoked by WindowTreeHost when it is activated. Notifies observers. |
85 void NotifyHostActivated(WindowTreeHost* host); | 86 void NotifyHostActivated(WindowTreeHost* host); |
86 | 87 |
(...skipping 14 matching lines...) Expand all Loading... | |
101 std::unique_ptr<ui::PlatformEventSource> event_source_; | 102 std::unique_ptr<ui::PlatformEventSource> event_source_; |
102 | 103 |
103 ui::ContextFactory* context_factory_; | 104 ui::ContextFactory* context_factory_; |
104 | 105 |
105 DISALLOW_COPY_AND_ASSIGN(Env); | 106 DISALLOW_COPY_AND_ASSIGN(Env); |
106 }; | 107 }; |
107 | 108 |
108 } // namespace aura | 109 } // namespace aura |
109 | 110 |
110 #endif // UI_AURA_ENV_H_ | 111 #endif // UI_AURA_ENV_H_ |
OLD | NEW |