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

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: Rebased 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
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/views/controls/menu/menu_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_switches.h" 10 #include "ui/ozone/ozone_switches.h"
10 #include "ui/ozone/platform_object.h" 11 #include "ui/ozone/platform_object.h"
11 #include "ui/ozone/platform_selection.h" 12 #include "ui/ozone/platform_selection.h"
12 13
13 namespace ui { 14 namespace ui {
14 15
15 namespace { 16 namespace {
16 17
17 bool g_platform_initialized_ui = false; 18 bool g_platform_initialized_ui = false;
(...skipping 13 matching lines...) Expand all
31 instance_ = NULL; 32 instance_ = NULL;
32 } 33 }
33 34
34 // static 35 // static
35 void OzonePlatform::InitializeForUI() { 36 void OzonePlatform::InitializeForUI() {
36 CreateInstance(); 37 CreateInstance();
37 if (g_platform_initialized_ui) 38 if (g_platform_initialized_ui)
38 return; 39 return;
39 g_platform_initialized_ui = true; 40 g_platform_initialized_ui = true;
40 instance_->InitializeUI(); 41 instance_->InitializeUI();
42 // This is deliberately created after initializing so that the platform can
43 // create its own version of DDM.
44 DeviceDataManager::CreateInstance();
41 } 45 }
42 46
43 // static 47 // static
44 void OzonePlatform::InitializeForGPU() { 48 void OzonePlatform::InitializeForGPU() {
45 CreateInstance(); 49 CreateInstance();
46 if (g_platform_initialized_gpu) 50 if (g_platform_initialized_gpu)
47 return; 51 return;
48 g_platform_initialized_gpu = true; 52 g_platform_initialized_gpu = true;
49 instance_->InitializeGPU(); 53 instance_->InitializeGPU();
50 } 54 }
(...skipping 16 matching lines...) Expand all
67 71
68 // TODO(spang): Currently need to leak this object. 72 // TODO(spang): Currently need to leak this object.
69 CHECK_EQ(instance_, platform.release()); 73 CHECK_EQ(instance_, platform.release());
70 } 74 }
71 } 75 }
72 76
73 // static 77 // static
74 OzonePlatform* OzonePlatform::instance_; 78 OzonePlatform* OzonePlatform::instance_;
75 79
76 } // namespace ui 80 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/views/controls/menu/menu_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698