Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: ui/ozone/ozone_platform.cc

Issue 289283015: Extract touchscreen device management into a generic manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/events/device_data_manager.h"
8 #include "ui/ozone/ozone_platform.h" 9 #include "ui/ozone/ozone_platform.h"
9 #include "ui/ozone/ozone_platform_list.h" 10 #include "ui/ozone/ozone_platform_list.h"
10 #include "ui/ozone/ozone_switches.h" 11 #include "ui/ozone/ozone_switches.h"
11 12
12 namespace ui { 13 namespace ui {
13 14
14 namespace { 15 namespace {
15 16
16 bool g_platform_initialized_ui = false; 17 bool g_platform_initialized_ui = false;
17 bool g_platform_initialized_gpu = false; 18 bool g_platform_initialized_gpu = false;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 OzonePlatform::~OzonePlatform() { 50 OzonePlatform::~OzonePlatform() {
50 CHECK_EQ(instance_, this); 51 CHECK_EQ(instance_, this);
51 instance_ = NULL; 52 instance_ = NULL;
52 } 53 }
53 54
54 // static 55 // static
55 void OzonePlatform::InitializeForUI() { 56 void OzonePlatform::InitializeForUI() {
56 CreateInstance(); 57 CreateInstance();
57 if (g_platform_initialized_ui) 58 if (g_platform_initialized_ui)
58 return; 59 return;
60 DeviceDataManager::Initialize();
59 g_platform_initialized_ui = true; 61 g_platform_initialized_ui = true;
60 instance_->InitializeUI(); 62 instance_->InitializeUI();
61 } 63 }
62 64
63 // static 65 // static
64 void OzonePlatform::InitializeForGPU() { 66 void OzonePlatform::InitializeForGPU() {
65 CreateInstance(); 67 CreateInstance();
66 if (g_platform_initialized_gpu) 68 if (g_platform_initialized_gpu)
67 return; 69 return;
68 g_platform_initialized_gpu = true; 70 g_platform_initialized_gpu = true;
(...skipping 12 matching lines...) Expand all
81 std::string platform = GetPlatformName(); 83 std::string platform = GetPlatformName();
82 TRACE_EVENT1("ozone", "OzonePlatform::Initialize", "platform", platform); 84 TRACE_EVENT1("ozone", "OzonePlatform::Initialize", "platform", platform);
83 CreatePlatform(platform); 85 CreatePlatform(platform);
84 } 86 }
85 } 87 }
86 88
87 // static 89 // static
88 OzonePlatform* OzonePlatform::instance_; 90 OzonePlatform* OzonePlatform::instance_;
89 91
90 } // namespace ui 92 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698