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

Unified Diff: chromeos/components/tether/initializer.cc

Issue 2870393003: Tether: only scan when asked to by NetworkStateHandler. (Closed)
Patch Set: Remove PowerManagerClient callbacks and implement all NetworkStateHandler callbacks. Created 3 years, 7 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 | « chromeos/components/tether/initializer.h ('k') | chromeos/components/tether/initializer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/components/tether/initializer.cc
diff --git a/chromeos/components/tether/initializer.cc b/chromeos/components/tether/initializer.cc
index 4faa3296693f9b9d9c32e657188c26a531235e49..d88ae944212d26a0ff62166a17f60231583ee719 100644
--- a/chromeos/components/tether/initializer.cc
+++ b/chromeos/components/tether/initializer.cc
@@ -218,15 +218,18 @@ void Initializer::OnBluetoothAdapterAdvertisingIntervalSet(
network_state_handler_, active_host_.get(),
tether_host_response_recorder_.get(),
device_id_tether_network_guid_map_.get());
+ clock_ = base::MakeUnique<base::DefaultClock>();
khorimoto 2017/05/30 17:39:10 Can you just pass this to the HostScanner construc
host_scanner_ = base::MakeUnique<HostScanner>(
tether_host_fetcher_.get(), ble_connection_manager_.get(),
host_scan_device_prioritizer_.get(), tether_host_response_recorder_.get(),
notification_presenter_.get(), device_id_tether_network_guid_map_.get(),
- host_scan_cache_.get());
+ host_scan_cache_.get(), clock_.get());
+ host_scan_scheduler_ = base::MakeUnique<HostScanScheduler>(
+ network_state_handler_, host_scanner_.get());
- // TODO(khorimoto): Hook up HostScanScheduler. Currently, we simply start a
- // new scan once the user logs in.
- host_scanner_->StartScan();
+ // Because Initializer is created on each user log in, it's appropriate to
+ // call this method now.
+ host_scan_scheduler_->UserLoggedIn();
}
void Initializer::OnBluetoothAdapterAdvertisingIntervalError(
« no previous file with comments | « chromeos/components/tether/initializer.h ('k') | chromeos/components/tether/initializer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698