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

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

Issue 2434563005: [sensors] Add a browser test to sanity check ambient light sensor. (Closed)
Patch Set: Fix nits found by Reilly Created 4 years, 1 month 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 #endif
12
13 namespace {
14
15 static device::PlatformSensorProvider* g_provider_for_testing = nullptr;
16
17 } // namespace
18
19 namespace device {
20
21 // static
22 void PlatformSensorProvider::SetProviderForTesting(
23 PlatformSensorProvider* provider) {
24 g_provider_for_testing = provider;
25 }
26
27 // static
28 PlatformSensorProvider* PlatformSensorProvider::GetInstance() {
29 if (g_provider_for_testing)
30 return g_provider_for_testing;
31 #if defined(OS_MACOSX)
32 return PlatformSensorProviderMac::GetInstance();
33 #elif defined(OS_ANDROID)
34 return PlatformSensorProviderAndroid::GetInstance();
35 #else
36 return nullptr;
37 #endif
38 }
39
40 } // 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