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

Unified Diff: chrome/browser/geolocation/wifi_data_provider_chromeos.cc

Issue 7747026: Inject the ChromeOS specific geocolation wifi data provider at runtime. This allows building cont... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/geolocation/wifi_data_provider_chromeos.cc
===================================================================
--- chrome/browser/geolocation/wifi_data_provider_chromeos.cc (revision 98335)
+++ chrome/browser/geolocation/wifi_data_provider_chromeos.cc (working copy)
@@ -17,8 +17,24 @@
const int kNoChangePollingIntervalMilliseconds = 2 * 60 * 1000; // 2 mins
const int kTwoNoChangePollingIntervalMilliseconds = 10 * 60 * 1000; // 10 mins
const int kNoWifiPollingIntervalMilliseconds = 20 * 1000; // 20s
+
+WifiDataProviderImplBase* ChromeOSFactoryFunction() {
+ return new WifiDataProviderChromeOs();
}
+// This global class forces code that links in this file to use that as a data
+// provider instead of the default Linux provider.
+class RegisterChromeOSWifiDataProvider {
+ public:
+ RegisterChromeOSWifiDataProvider() {
+ WifiDataProvider::SetFactory(ChromeOSFactoryFunction);
+ }
+};
+
+RegisterChromeOSWifiDataProvider g_force_chrome_os_provider;
+
+} // namespace
+
namespace chromeos {
namespace {
// Wifi API binding to network_library.h, to allow reuse of the polling behavior
@@ -68,15 +84,9 @@
} // namespace
} // namespace chromeos
-template<>
-WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() {
- return new WifiDataProviderChromeOs();
+WifiDataProviderChromeOs::WifiDataProviderChromeOs() : started_(false) {
}
-WifiDataProviderChromeOs::WifiDataProviderChromeOs() :
- started_(false) {
-}
-
WifiDataProviderChromeOs::~WifiDataProviderChromeOs() {
}
@@ -160,8 +170,7 @@
if (!wlan_api_->GetAccessPointData(&new_data.access_point_data)) {
client_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &WifiDataProviderChromeOs::DidWifiScanTaskNoResults));
- }
- else {
+ } else {
client_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &WifiDataProviderChromeOs::DidWifiScanTask,
new_data));
« no previous file with comments | « no previous file | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698