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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 //////////////////////////////////////////////////////////////////////////////// | 43 //////////////////////////////////////////////////////////////////////////////// |
44 // Env, public: | 44 // Env, public: |
45 | 45 |
46 Env::~Env() { | 46 Env::~Env() { |
47 if (is_os_exchange_data_provider_factory_) | 47 if (is_os_exchange_data_provider_factory_) |
48 ui::OSExchangeDataProviderFactory::SetFactory(nullptr); | 48 ui::OSExchangeDataProviderFactory::SetFactory(nullptr); |
49 | 49 |
50 for (EnvObserver& observer : observers_) | 50 for (EnvObserver& observer : observers_) |
51 observer.OnWillDestroyEnv(); | 51 observer.OnWillDestroyEnv(); |
| 52 |
| 53 #if defined(USE_OZONE) |
| 54 ui::OzonePlatform::Shutdown(); |
| 55 #endif |
| 56 |
52 DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get()); | 57 DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get()); |
53 lazy_tls_ptr.Pointer()->Set(NULL); | 58 lazy_tls_ptr.Pointer()->Set(NULL); |
54 } | 59 } |
55 | 60 |
56 // static | 61 // static |
57 std::unique_ptr<Env> Env::CreateInstance(Mode mode) { | 62 std::unique_ptr<Env> Env::CreateInstance(Mode mode) { |
58 DCHECK(!lazy_tls_ptr.Pointer()->Get()); | 63 DCHECK(!lazy_tls_ptr.Pointer()->Get()); |
59 std::unique_ptr<Env> env(new Env(mode)); | 64 std::unique_ptr<Env> env(new Env(mode)); |
60 env->Init(); | 65 env->Init(); |
61 return env; | 66 return env; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 ui::EventTargeter* Env::GetEventTargeter() { | 206 ui::EventTargeter* Env::GetEventTargeter() { |
202 NOTREACHED(); | 207 NOTREACHED(); |
203 return NULL; | 208 return NULL; |
204 } | 209 } |
205 | 210 |
206 std::unique_ptr<ui::OSExchangeData::Provider> Env::BuildProvider() { | 211 std::unique_ptr<ui::OSExchangeData::Provider> Env::BuildProvider() { |
207 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | 212 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); |
208 } | 213 } |
209 | 214 |
210 } // namespace aura | 215 } // namespace aura |
OLD | NEW |