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

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

Issue 2945643002: [CrOS Tether] Sort Tether network lists. (Closed)
Patch Set: stevenjb@ comments. Created 3 years, 6 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
Index: chromeos/components/tether/initializer.cc
diff --git a/chromeos/components/tether/initializer.cc b/chromeos/components/tether/initializer.cc
index fe1ed4f0c4e1ea4bd7ab093381ca36b86f358747..62b9ecdf0cacda62752f418eb3ef8c48d7609d8f 100644
--- a/chromeos/components/tether/initializer.cc
+++ b/chromeos/components/tether/initializer.cc
@@ -10,7 +10,7 @@
#include "chromeos/components/tether/ble_connection_manager.h"
#include "chromeos/components/tether/device_id_tether_network_guid_map.h"
#include "chromeos/components/tether/host_scan_cache.h"
-#include "chromeos/components/tether/host_scan_device_prioritizer.h"
+#include "chromeos/components/tether/host_scan_device_prioritizer_impl.h"
#include "chromeos/components/tether/host_scan_scheduler.h"
#include "chromeos/components/tether/host_scanner.h"
#include "chromeos/components/tether/keep_alive_scheduler.h"
@@ -130,6 +130,7 @@ Initializer::Initializer(
Initializer::~Initializer() {
token_service_->RemoveObserver(this);
+ network_state_handler_->set_tether_sort_delegate(nullptr);
}
void Initializer::FetchBluetoothAdapter() {
@@ -183,8 +184,14 @@ void Initializer::OnBluetoothAdapterAdvertisingIntervalSet(
cryptauth::BluetoothThrottlerImpl::GetInstance());
tether_host_response_recorder_ =
base::MakeUnique<TetherHostResponseRecorder>(pref_service_);
- host_scan_device_prioritizer_ = base::MakeUnique<HostScanDevicePrioritizer>(
- tether_host_response_recorder_.get());
+ device_id_tether_network_guid_map_ =
+ base::MakeUnique<DeviceIdTetherNetworkGuidMap>();
+ host_scan_device_prioritizer_ =
+ base::MakeUnique<HostScanDevicePrioritizerImpl>(
+ tether_host_response_recorder_.get(),
+ device_id_tether_network_guid_map_.get());
+ network_state_handler_->set_tether_sort_delegate(
+ host_scan_device_prioritizer_.get());
wifi_hotspot_connector_ = base::MakeUnique<WifiHotspotConnector>(
network_state_handler_, network_connect_);
active_host_ =
@@ -192,8 +199,6 @@ void Initializer::OnBluetoothAdapterAdvertisingIntervalSet(
active_host_network_state_updater_ =
base::MakeUnique<ActiveHostNetworkStateUpdater>(active_host_.get(),
network_state_handler_);
- device_id_tether_network_guid_map_ =
- base::MakeUnique<DeviceIdTetherNetworkGuidMap>();
host_scan_cache_ = base::MakeUnique<HostScanCache>(
network_state_handler_, active_host_.get(),
tether_host_response_recorder_.get(),
« no previous file with comments | « chromeos/components/tether/initializer.h ('k') | chromeos/components/tether/mock_host_scan_device_prioritizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698