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

Side by Side Diff: chrome/browser/geolocation/wifi_data_provider_chromeos.cc

Issue 3027042: Speculative fix for chromium-os:4706 - use singleton NetworkLibrary rather than create our own (Closed)
Patch Set: Rebase Created 10 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/geolocation/wifi_data_provider_chromeos.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Provides wifi scan API binding for chromeos, using proprietary APIs. 5 // Provides wifi scan API binding for chromeos, using proprietary APIs.
6 6
7 #include "chrome/browser/geolocation/wifi_data_provider_chromeos.h" 7 #include "chrome/browser/geolocation/wifi_data_provider_chromeos.h"
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/cros/cros_library.h" 10 #include "chrome/browser/chromeos/cros/cros_library.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 WifiDataProviderChromeOs::~WifiDataProviderChromeOs() { 78 WifiDataProviderChromeOs::~WifiDataProviderChromeOs() {
79 } 79 }
80 80
81 WifiDataProviderCommon::WlanApiInterface* 81 WifiDataProviderCommon::WlanApiInterface*
82 WifiDataProviderChromeOs::NewWlanApi(chromeos::NetworkLibrary* lib) { 82 WifiDataProviderChromeOs::NewWlanApi(chromeos::NetworkLibrary* lib) {
83 return new chromeos::NetworkLibraryWlanApi(lib); 83 return new chromeos::NetworkLibraryWlanApi(lib);
84 } 84 }
85 85
86 WifiDataProviderCommon::WlanApiInterface* 86 WifiDataProviderCommon::WlanApiInterface*
87 WifiDataProviderChromeOs::NewWlanApi() { 87 WifiDataProviderChromeOs::NewWlanApi() {
88 if (network_library_ == NULL) { 88 chromeos::CrosLibrary* cros_lib = chromeos::CrosLibrary::Get();
89 network_library_.reset(chromeos::CrosLibrary::Get()->GetNetworkLibrary()); 89 DCHECK(cros_lib);
90 // TODO(joth): Check net_lib loaded ok, if not return NULL. 90 if (!cros_lib->EnsureLoaded())
91 } 91 return NULL;
92 return NewWlanApi(network_library_.get()); 92 return NewWlanApi(cros_lib->GetNetworkLibrary());
93 } 93 }
94 94
95 PollingPolicyInterface* WifiDataProviderChromeOs::NewPollingPolicy() { 95 PollingPolicyInterface* WifiDataProviderChromeOs::NewPollingPolicy() {
96 return new GenericPollingPolicy<kDefaultPollingIntervalMilliseconds, 96 return new GenericPollingPolicy<kDefaultPollingIntervalMilliseconds,
97 kNoChangePollingIntervalMilliseconds, 97 kNoChangePollingIntervalMilliseconds,
98 kTwoNoChangePollingIntervalMilliseconds, 98 kTwoNoChangePollingIntervalMilliseconds,
99 kNoWifiPollingIntervalMilliseconds>; 99 kNoWifiPollingIntervalMilliseconds>;
100 } 100 }
OLDNEW
« no previous file with comments | « chrome/browser/geolocation/wifi_data_provider_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698