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

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

Issue 2913313002: Tether: Persist if first-time setup is required to HostScanCache. (Closed)
Patch Set: khorimoto@ 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/components/tether/fake_host_scan_cache.h ('k') | chromeos/components/tether/host_scan_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/components/tether/fake_host_scan_cache.cc
diff --git a/chromeos/components/tether/fake_host_scan_cache.cc b/chromeos/components/tether/fake_host_scan_cache.cc
index 917a13a0f0a44528e8166c0a008a497102efa928..fae2ff673e2d9c47dbc2fc786c53fb2940ed01b8 100644
--- a/chromeos/components/tether/fake_host_scan_cache.cc
+++ b/chromeos/components/tether/fake_host_scan_cache.cc
@@ -51,7 +51,8 @@ void FakeHostScanCache::SetHostScanResult(
const std::string& device_name,
const std::string& carrier,
int battery_percentage,
- int signal_strength) {
+ int signal_strength,
+ bool setup_required) {
auto it = cache_.find(tether_network_guid);
if (it != cache_.end()) {
// If already in the cache, update the cache with new values.
@@ -59,13 +60,14 @@ void FakeHostScanCache::SetHostScanResult(
it->second.carrier = carrier;
it->second.battery_percentage = battery_percentage;
it->second.signal_strength = signal_strength;
+ it->second.setup_required = setup_required;
return;
}
// Otherwise, add a new entry.
- cache_.emplace(
- tether_network_guid,
- CacheEntry{device_name, carrier, battery_percentage, signal_strength});
+ cache_.emplace(tether_network_guid,
+ CacheEntry{device_name, carrier, battery_percentage,
+ signal_strength, setup_required});
}
bool FakeHostScanCache::RemoveHostScanResult(
@@ -86,6 +88,15 @@ void FakeHostScanCache::ClearCacheExceptForActiveHost() {
}
}
+bool FakeHostScanCache::DoesHostRequireSetup(
+ const std::string& tether_network_guid) {
+ auto it = cache_.find(tether_network_guid);
+ if (it != cache_.end())
+ return it->second.setup_required;
+
+ return false;
+}
+
void FakeHostScanCache::OnPreviouslyConnectedHostIdsChanged() {}
} // namespace tether
« no previous file with comments | « chromeos/components/tether/fake_host_scan_cache.h ('k') | chromeos/components/tether/host_scan_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698