OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/command_line.h" | 5 #include "ui/ozone/public/ozone_platform.h" |
| 6 |
6 #include "base/logging.h" | 7 #include "base/logging.h" |
7 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
8 #include "ui/events/devices/device_data_manager.h" | 9 #include "ui/events/devices/device_data_manager.h" |
9 #include "ui/ozone/platform_object.h" | 10 #include "ui/ozone/platform_object.h" |
10 #include "ui/ozone/platform_selection.h" | 11 #include "ui/ozone/platform_selection.h" |
11 #include "ui/ozone/public/ozone_platform.h" | |
12 #include "ui/ozone/public/ozone_switches.h" | 12 #include "ui/ozone/public/ozone_switches.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 bool g_platform_initialized_ui = false; | 18 bool g_platform_initialized_ui = false; |
19 bool g_platform_initialized_gpu = false; | 19 bool g_platform_initialized_gpu = false; |
20 | 20 |
21 } | 21 } // namespace |
22 | 22 |
23 OzonePlatform::OzonePlatform() { | 23 OzonePlatform::OzonePlatform() { |
24 DCHECK(!instance_) << "There should only be a single OzonePlatform."; | 24 DCHECK(!instance_) << "There should only be a single OzonePlatform."; |
25 instance_ = this; | 25 instance_ = this; |
26 g_platform_initialized_ui = false; | 26 g_platform_initialized_ui = false; |
27 g_platform_initialized_gpu = false; | 27 g_platform_initialized_gpu = false; |
28 } | 28 } |
29 | 29 |
30 OzonePlatform::~OzonePlatform() { | 30 OzonePlatform::~OzonePlatform() { |
31 DCHECK_EQ(instance_, this); | 31 DCHECK_EQ(instance_, this); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return nullptr; | 89 return nullptr; |
90 } | 90 } |
91 | 91 |
92 base::MessageLoop::Type OzonePlatform::GetMessageLoopTypeForGpu() { | 92 base::MessageLoop::Type OzonePlatform::GetMessageLoopTypeForGpu() { |
93 return base::MessageLoop::TYPE_DEFAULT; | 93 return base::MessageLoop::TYPE_DEFAULT; |
94 } | 94 } |
95 | 95 |
96 void OzonePlatform::AddInterfaces( | 96 void OzonePlatform::AddInterfaces( |
97 service_manager::InterfaceRegistry* registry) {} | 97 service_manager::InterfaceRegistry* registry) {} |
98 | 98 |
| 99 ScopedOzonePlatformForTesting::ScopedOzonePlatformForTesting( |
| 100 OzonePlatform* test_instance) |
| 101 : auto_reset_(&OzonePlatform::instance_, test_instance) {} |
| 102 |
| 103 ScopedOzonePlatformForTesting::~ScopedOzonePlatformForTesting() = default; |
| 104 |
99 } // namespace ui | 105 } // namespace ui |
OLD | NEW |