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

Unified Diff: chromeos/components/tether/host_scan_cache.h

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.cc ('k') | chromeos/components/tether/host_scan_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/components/tether/host_scan_cache.h
diff --git a/chromeos/components/tether/host_scan_cache.h b/chromeos/components/tether/host_scan_cache.h
index 3d705e48887befdade932759600fb22c07be863b..762f3ef9715cfee5f1690c3e257572918f0670f7 100644
--- a/chromeos/components/tether/host_scan_cache.h
+++ b/chromeos/components/tether/host_scan_cache.h
@@ -58,11 +58,15 @@ class HostScanCache : public TetherHostResponseRecorder::Observer {
// Note: |signal_strength| should be in the range [0, 100]. This is different
// from the |connection_strength| field received in ConnectTetheringResponse
// and KeepAliveTickleResponse messages (the range is [0, 4] in those cases).
+ // |battery_percentage| should also be in the range [0, 100].
+ // |setup_required| indicates that the host device requires first-time setup,
+ // i.e., user interaction to allow tethering.
virtual void SetHostScanResult(const std::string& tether_network_guid,
const std::string& device_name,
const std::string& carrier,
int battery_percentage,
- int signal_strength);
+ int signal_strength,
+ bool setup_required);
// Removes the scan result with GUID |tether_network_guid| from the cache. If
// no cache result with that GUID was present in the cache, this function is
@@ -74,6 +78,10 @@ class HostScanCache : public TetherHostResponseRecorder::Observer {
// connecting/connected to ensure the UI is up to date.
virtual void ClearCacheExceptForActiveHost();
+ // Returns true if the host device requires first-time setup, i.e., user
+ // interaction to allow tethering.
+ virtual bool DoesHostRequireSetup(const std::string& tether_network_guid);
+
// TetherHostResponseRecorder::Observer:
void OnPreviouslyConnectedHostIdsChanged() override;
@@ -99,6 +107,7 @@ class HostScanCache : public TetherHostResponseRecorder::Observer {
// host).
std::unordered_map<std::string, std::unique_ptr<base::Timer>>
tether_guid_to_timer_map_;
+ std::unordered_set<std::string> setup_required_tether_guids_;
base::WeakPtrFactory<HostScanCache> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(HostScanCache);
« no previous file with comments | « chromeos/components/tether/fake_host_scan_cache.cc ('k') | chromeos/components/tether/host_scan_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698