OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/command_line.h" |
6 #include "base/debug/trace_event.h" | 6 #include "base/debug/trace_event.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" | |
9 #include "ui/events/ozone/event_factory_ozone.h" | |
10 #include "ui/gfx/ozone/surface_factory_ozone.h" | |
11 #include "ui/ozone/ime/input_method_context_factory_ozone.h" | |
12 #include "ui/ozone/ozone_platform.h" | 8 #include "ui/ozone/ozone_platform.h" |
13 #include "ui/ozone/ozone_platform_list.h" | 9 #include "ui/ozone/ozone_platform_list.h" |
14 #include "ui/ozone/ozone_switches.h" | 10 #include "ui/ozone/ozone_switches.h" |
15 | 11 |
16 namespace ui { | 12 namespace ui { |
17 | 13 |
18 namespace { | 14 namespace { |
19 | 15 |
20 bool g_platform_initialized_ui = false; | 16 bool g_platform_initialized_ui = false; |
21 bool g_platform_initialized_gpu = false; | 17 bool g_platform_initialized_gpu = false; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 instance_ = NULL; | 51 instance_ = NULL; |
56 } | 52 } |
57 | 53 |
58 // static | 54 // static |
59 void OzonePlatform::InitializeForUI() { | 55 void OzonePlatform::InitializeForUI() { |
60 CreateInstance(); | 56 CreateInstance(); |
61 if (g_platform_initialized_ui) | 57 if (g_platform_initialized_ui) |
62 return; | 58 return; |
63 g_platform_initialized_ui = true; | 59 g_platform_initialized_ui = true; |
64 instance_->InitializeUI(); | 60 instance_->InitializeUI(); |
65 ui::InputMethodContextFactoryOzone::SetInstance( | |
66 instance_->GetInputMethodContextFactoryOzone()); | |
67 } | 61 } |
68 | 62 |
69 // static | 63 // static |
70 void OzonePlatform::InitializeForGPU() { | 64 void OzonePlatform::InitializeForGPU() { |
71 CreateInstance(); | 65 CreateInstance(); |
72 if (g_platform_initialized_gpu) | 66 if (g_platform_initialized_gpu) |
73 return; | 67 return; |
74 g_platform_initialized_gpu = true; | 68 g_platform_initialized_gpu = true; |
75 instance_->InitializeGPU(); | 69 instance_->InitializeGPU(); |
76 } | 70 } |
(...skipping 10 matching lines...) Expand all Loading... |
87 std::string platform = GetPlatformName(); | 81 std::string platform = GetPlatformName(); |
88 TRACE_EVENT1("ozone", "OzonePlatform::Initialize", "platform", platform); | 82 TRACE_EVENT1("ozone", "OzonePlatform::Initialize", "platform", platform); |
89 CreatePlatform(platform); | 83 CreatePlatform(platform); |
90 } | 84 } |
91 } | 85 } |
92 | 86 |
93 // static | 87 // static |
94 OzonePlatform* OzonePlatform::instance_; | 88 OzonePlatform* OzonePlatform::instance_; |
95 | 89 |
96 } // namespace ui | 90 } // namespace ui |
OLD | NEW |