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 #include "ui/aura/env.h" | 5 #include "ui/aura/env.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
11 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
12 #include "ui/aura/client/focus_client.h" | 12 #include "ui/aura/client/focus_client.h" |
13 #include "ui/aura/env_observer.h" | 13 #include "ui/aura/env_observer.h" |
14 #include "ui/aura/input_state_lookup.h" | 14 #include "ui/aura/input_state_lookup.h" |
15 #include "ui/aura/mus/mus_types.h" | 15 #include "ui/aura/mus/mus_types.h" |
16 #include "ui/aura/mus/os_exchange_data_provider_mus.h" | |
16 #include "ui/aura/mus/window_port_mus.h" | 17 #include "ui/aura/mus/window_port_mus.h" |
17 #include "ui/aura/mus/window_tree_client.h" | 18 #include "ui/aura/mus/window_tree_client.h" |
18 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
19 #include "ui/aura/window_observer.h" | 20 #include "ui/aura/window_observer.h" |
20 #include "ui/aura/window_port_local.h" | 21 #include "ui/aura/window_port_local.h" |
21 #include "ui/events/event_target_iterator.h" | 22 #include "ui/events/event_target_iterator.h" |
22 #include "ui/events/platform/platform_event_source.h" | 23 #include "ui/events/platform/platform_event_source.h" |
23 | 24 |
24 #if defined(USE_OZONE) | 25 #if defined(USE_OZONE) |
25 #include "ui/ozone/public/ozone_platform.h" | 26 #include "ui/ozone/public/ozone_platform.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 is_touch_down_(false), | 186 is_touch_down_(false), |
186 get_last_mouse_location_from_mus_(mode_ == Mode::MUS), | 187 get_last_mouse_location_from_mus_(mode_ == Mode::MUS), |
187 input_state_lookup_(InputStateLookup::Create()), | 188 input_state_lookup_(InputStateLookup::Create()), |
188 context_factory_(nullptr), | 189 context_factory_(nullptr), |
189 context_factory_private_(nullptr) { | 190 context_factory_private_(nullptr) { |
190 DCHECK(lazy_tls_ptr.Pointer()->Get() == NULL); | 191 DCHECK(lazy_tls_ptr.Pointer()->Get() == NULL); |
191 lazy_tls_ptr.Pointer()->Set(this); | 192 lazy_tls_ptr.Pointer()->Set(this); |
192 } | 193 } |
193 | 194 |
194 void Env::Init() { | 195 void Env::Init() { |
195 if (RunningInsideMus()) | 196 if (RunningInsideMus()) { |
197 ui::OSExchangeDataProviderFactory::SetFactory(this); | |
sky
2017/03/10 21:00:57
Unset this in the destructor, which matters for te
Elliot Glaysher
2017/03/10 21:30:07
Done.
| |
196 return; | 198 return; |
199 } | |
200 | |
197 #if defined(USE_OZONE) | 201 #if defined(USE_OZONE) |
198 // The ozone platform can provide its own event source. So initialize the | 202 // The ozone platform can provide its own event source. So initialize the |
199 // platform before creating the default event source. If running inside mus | 203 // platform before creating the default event source. If running inside mus |
200 // let the mus process initialize ozone instead. | 204 // let the mus process initialize ozone instead. |
201 ui::OzonePlatform::InitializeForUI(); | 205 ui::OzonePlatform::InitializeForUI(); |
202 #endif | 206 #endif |
203 if (!ui::PlatformEventSource::GetInstance()) | 207 if (!ui::PlatformEventSource::GetInstance()) |
204 event_source_ = ui::PlatformEventSource::CreateDefault(); | 208 event_source_ = ui::PlatformEventSource::CreateDefault(); |
205 } | 209 } |
206 | 210 |
(...skipping 29 matching lines...) Expand all Loading... | |
236 | 240 |
237 std::unique_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { | 241 std::unique_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { |
238 return nullptr; | 242 return nullptr; |
239 } | 243 } |
240 | 244 |
241 ui::EventTargeter* Env::GetEventTargeter() { | 245 ui::EventTargeter* Env::GetEventTargeter() { |
242 NOTREACHED(); | 246 NOTREACHED(); |
243 return NULL; | 247 return NULL; |
244 } | 248 } |
245 | 249 |
250 std::unique_ptr<ui::OSExchangeData::Provider> Env::BuildProvider() { | |
251 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | |
252 } | |
253 | |
246 } // namespace aura | 254 } // namespace aura |
OLD | NEW |