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

Side by Side Diff: chromeos/components/tether/host_scanner.cc

Issue 2850993002: [CrOS Tether] Add the HasConnectedToHost network field to NetworkStateHandler. (Closed)
Patch Set: stevenjb@ comments. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "chromeos/components/tether/host_scanner.h" 5 #include "chromeos/components/tether/host_scanner.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "chromeos/components/tether/device_id_tether_network_guid_map.h" 10 #include "chromeos/components/tether/device_id_tether_network_guid_map.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 status.has_connection_strength() 115 status.has_connection_strength()
116 ? ForceBetweenZeroAndOneHundred( 116 ? ForceBetweenZeroAndOneHundred(
117 kAndroidTetherHostToChromeOSSignalStrengthMultiplier * 117 kAndroidTetherHostToChromeOSSignalStrengthMultiplier *
118 status.connection_strength()) 118 status.connection_strength())
119 : 100; 119 : 100;
120 120
121 // TODO(khorimoto): Pass a HasConnectedToHost parameter to this function. 121 // TODO(khorimoto): Pass a HasConnectedToHost parameter to this function.
122 network_state_handler_->AddTetherNetworkState( 122 network_state_handler_->AddTetherNetworkState(
123 device_id_tether_network_guid_map_->GetTetherNetworkGuidForDeviceId( 123 device_id_tether_network_guid_map_->GetTetherNetworkGuidForDeviceId(
124 remote_device.GetDeviceId()), 124 remote_device.GetDeviceId()),
125 remote_device.name, carrier, battery_percentage, signal_strength); 125 remote_device.name, carrier, battery_percentage, signal_strength,
126 false /* has_connected_to_host */);
126 } 127 }
127 128
128 if (scanned_device_list_so_far.size() == 1) { 129 if (scanned_device_list_so_far.size() == 1) {
129 notification_presenter_->NotifyPotentialHotspotNearby( 130 notification_presenter_->NotifyPotentialHotspotNearby(
130 scanned_device_list_so_far.at(0).remote_device); 131 scanned_device_list_so_far.at(0).remote_device);
131 } else { 132 } else {
132 notification_presenter_->NotifyMultiplePotentialHotspotsNearby(); 133 notification_presenter_->NotifyMultiplePotentialHotspotsNearby();
133 } 134 }
134 } 135 }
135 136
136 if (is_final_scan_result) { 137 if (is_final_scan_result) {
137 // If the final scan result has been received, the operation is finished. 138 // If the final scan result has been received, the operation is finished.
138 // Delete it. 139 // Delete it.
139 host_scanner_operation_->RemoveObserver(this); 140 host_scanner_operation_->RemoveObserver(this);
140 host_scanner_operation_.reset(); 141 host_scanner_operation_.reset();
141 } 142 }
142 } 143 }
143 144
144 } // namespace tether 145 } // namespace tether
145 146
146 } // namespace chromeos 147 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698