summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorgspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-13 01:15:33 +0000
committergspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-13 01:15:33 +0000
commitef2ddd2b80066e94fec967dd3372e303af07134a (patch)
tree990ba4b8aa1f489c03cd71b1f9faf79654ed54a0 /chromeos
parentf21b3ad73778cb3cfd7dcc06a270b09d9c99074d (diff)
downloadchromium_src-ef2ddd2b80066e94fec967dd3372e303af07134a.zip
chromium_src-ef2ddd2b80066e94fec967dd3372e303af07134a.tar.gz
chromium_src-ef2ddd2b80066e94fec967dd3372e303af07134a.tar.bz2
This adds networkingPrivate.requestNetworkScan function
to trigger a scan of networks to update the list of networks. BUG=chromium:225587 Review URL: https://chromiumcodereview.appspot.com/14103014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/dbus/shill_manager_client_stub.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/chromeos/dbus/shill_manager_client_stub.cc b/chromeos/dbus/shill_manager_client_stub.cc
index aa58ddf..2bac7dc 100644
--- a/chromeos/dbus/shill_manager_client_stub.cc
+++ b/chromeos/dbus/shill_manager_client_stub.cc
@@ -108,11 +108,16 @@ void ShillManagerClientStub::RequestScan(const std::string& type,
base::FundamentalValue(true));
}
const int kScanDurationSeconds = 3;
+ int scan_duration_seconds = kScanDurationSeconds;
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableStubInteractive)) {
+ scan_duration_seconds = 0;
+ }
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&ShillManagerClientStub::ScanCompleted,
weak_ptr_factory_.GetWeakPtr(), device_path, callback),
- base::TimeDelta::FromSeconds(kScanDurationSeconds));
+ base::TimeDelta::FromSeconds(scan_duration_seconds));
}
void ShillManagerClientStub::EnableTechnology(
@@ -433,6 +438,12 @@ void ShillManagerClientStub::PassStubGeoNetworks(
void ShillManagerClientStub::CallNotifyObserversPropertyChanged(
const std::string& property,
int delay_ms) {
+ // Don't actually delay unless we're interactive.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableStubInteractive)) {
+ delay_ms = 0;
+ }
+
// Avoid unnecessary delayed task if we have no observers (e.g. during
// initial setup).
if (observer_list_.size() == 0)
@@ -527,6 +538,9 @@ void ShillManagerClientStub::ScanCompleted(const std::string& device_path,
flimflam::kScanningProperty,
base::FundamentalValue(false));
}
+ CallNotifyObserversPropertyChanged(flimflam::kServicesProperty, 0);
+ CallNotifyObserversPropertyChanged(flimflam::kServiceWatchListProperty,
+ 0);
if (!callback.is_null())
MessageLoop::current()->PostTask(FROM_HERE, callback);
}