| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/device_orientation/provider.h" | 5 #include "chrome/browser/device_orientation/provider.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chrome_thread.h" |
| 9 #include "chrome/browser/device_orientation/data_fetcher.h" |
| 10 #include "chrome/browser/device_orientation/provider_impl.h" |
| 11 |
| 7 namespace device_orientation { | 12 namespace device_orientation { |
| 8 | 13 |
| 9 Provider* Provider::GetInstance() { | 14 Provider* Provider::GetInstance() { |
| 10 if (!instance_) | 15 if (!instance_) { |
| 11 // TODO(hans) This is not finished. We will create an instance of the real | 16 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 12 // Provider implementation once it is implemented. | 17 const ProviderImpl::DataFetcherFactory default_factories[] = { NULL }; |
| 13 instance_ = new Provider(); | 18 |
| 19 instance_ = new ProviderImpl(MessageLoop::current(), default_factories); |
| 20 } |
| 14 return instance_; | 21 return instance_; |
| 15 } | 22 } |
| 16 | 23 |
| 17 void Provider::SetInstanceForTests(Provider* provider) { | 24 void Provider::SetInstanceForTests(Provider* provider) { |
| 18 DCHECK(!instance_); | 25 DCHECK(!instance_); |
| 19 instance_ = provider; | 26 instance_ = provider; |
| 20 } | 27 } |
| 21 | 28 |
| 22 Provider* Provider::instance_ = NULL; | 29 Provider* Provider::instance_ = NULL; |
| 23 | 30 |
| 24 } // namespace device_orientation | 31 } // namespace device_orientation |
| OLD | NEW |