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

Side by Side Diff: device/generic_sensor/platform_sensor_provider.cc

Issue 2865263002: Move //device/generic_sensor to be part of the internal implementation of the Device Service. (Closed)
Patch Set: code rebase Created 3 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "device/generic_sensor/platform_sensor_provider.h"
6
7 #if defined(OS_MACOSX)
8 #include "device/generic_sensor/platform_sensor_provider_mac.h"
9 #elif defined(OS_ANDROID)
10 #include "device/generic_sensor/platform_sensor_provider_android.h"
11 #elif defined(OS_WIN)
12 #include "device/generic_sensor/platform_sensor_provider_win.h"
13 #elif defined(OS_LINUX) && defined(USE_UDEV)
14 #include "device/generic_sensor/platform_sensor_provider_linux.h"
15 #endif
16
17 namespace {
18
19 static device::PlatformSensorProvider* g_provider_for_testing = nullptr;
20
21 } // namespace
22
23 namespace device {
24
25 // static
26 void PlatformSensorProvider::SetProviderForTesting(
27 PlatformSensorProvider* provider) {
28 g_provider_for_testing = provider;
29 }
30
31 // static
32 PlatformSensorProvider* PlatformSensorProvider::GetInstance() {
33 if (g_provider_for_testing)
34 return g_provider_for_testing;
35 #if defined(OS_MACOSX)
36 return PlatformSensorProviderMac::GetInstance();
37 #elif defined(OS_ANDROID)
38 return PlatformSensorProviderAndroid::GetInstance();
39 #elif defined(OS_WIN)
40 return PlatformSensorProviderWin::GetInstance();
41 #elif defined(OS_LINUX) && defined(USE_UDEV)
42 return PlatformSensorProviderLinux::GetInstance();
43 #else
44 return nullptr;
45 #endif
46 }
47
48 } // namespace device
OLDNEW
« no previous file with comments | « device/generic_sensor/platform_sensor_provider.h ('k') | device/generic_sensor/platform_sensor_provider_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698