OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/device_orientation/provider.h" | 5 #include "content/browser/device_orientation/provider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/device_orientation/data_fetcher.h" | 8 #include "content/browser/device_orientation/data_fetcher.h" |
9 #include "content/browser/device_orientation/provider_impl.h" | 9 #include "content/browser/device_orientation/provider_impl.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 | 11 |
12 #if defined(OS_MACOSX) | 12 #if defined(OS_MACOSX) |
13 #include "content/browser/device_orientation/accelerometer_mac.h" | 13 #include "content/browser/device_orientation/accelerometer_mac.h" |
14 #elif defined(OS_ANDROID) | 14 #elif defined(OS_ANDROID) |
15 #include "content/browser/device_orientation/data_fetcher_impl_android.h" | 15 #include "content/browser/device_orientation/data_fetcher_impl_android.h" |
16 #endif | 16 #endif |
17 | 17 |
18 using content::BrowserThread; | |
19 | |
20 namespace content { | 18 namespace content { |
21 | 19 |
22 Provider* Provider::GetInstance() { | 20 Provider* Provider::GetInstance() { |
23 if (!instance_) { | 21 if (!instance_) { |
24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 22 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
25 ProviderImpl::DataFetcherFactory default_factory = NULL; | 23 ProviderImpl::DataFetcherFactory default_factory = NULL; |
26 | 24 |
27 #if defined(OS_MACOSX) | 25 #if defined(OS_MACOSX) |
28 default_factory = AccelerometerMac::Create; | 26 default_factory = AccelerometerMac::Create; |
29 #elif defined(OS_ANDROID) | 27 #elif defined(OS_ANDROID) |
(...skipping 18 matching lines...) Expand all Loading... |
48 } | 46 } |
49 | 47 |
50 Provider::~Provider() { | 48 Provider::~Provider() { |
51 DCHECK(instance_ == this); | 49 DCHECK(instance_ == this); |
52 instance_ = NULL; | 50 instance_ = NULL; |
53 } | 51 } |
54 | 52 |
55 Provider* Provider::instance_ = NULL; | 53 Provider* Provider::instance_ = NULL; |
56 | 54 |
57 } // namespace content | 55 } // namespace content |
OLD | NEW |