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

Unified Diff: chrome/browser/chromeos/tether/tether_service.cc

Issue 2961733002: [CrOS Tether] Remove spammy log from Initializer. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chromeos/components/tether/initializer.h » ('j') | chromeos/components/tether/initializer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/tether/tether_service.cc
diff --git a/chrome/browser/chromeos/tether/tether_service.cc b/chrome/browser/chromeos/tether/tether_service.cc
index 173b014d99a2b8041ff8411d3ae4f4712ee5d2d2..c91e10a95694b747ecf70b69e40619e36c2776f9 100644
--- a/chrome/browser/chromeos/tether/tether_service.cc
+++ b/chrome/browser/chromeos/tether/tether_service.cc
@@ -198,15 +198,24 @@ bool TetherService::HasSyncedTetherHosts() const {
}
void TetherService::UpdateTetherTechnologyState() {
- chromeos::NetworkStateHandler::TechnologyState tether_technology_state =
+ bool was_tether_enabled = network_state_handler_->IsTechnologyEnabled(
+ chromeos::NetworkTypePattern::Tether());
+
+ chromeos::NetworkStateHandler::TechnologyState new_tether_technology_state =
GetTetherTechnologyState();
- network_state_handler_->SetTetherTechnologyState(tether_technology_state);
+ network_state_handler_->SetTetherTechnologyState(new_tether_technology_state);
- if (tether_technology_state ==
- chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED) {
+ if (!was_tether_enabled &&
Ryan Hansberry 2017/06/26 23:55:08 Please add a test.
Kyle Horimoto 2017/06/27 00:56:01 Added tests. When testing, I realized that this is
+ new_tether_technology_state ==
+ chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED) {
+ // Start if the feature is enabled and was not previously running.
StartTetherIfEnabled();
- } else {
+ } else if (was_tether_enabled &&
+ new_tether_technology_state !=
+ chromeos::NetworkStateHandler::TechnologyState::
+ TECHNOLOGY_ENABLED) {
+ // Stop if the feature is not enabled and was previously running.
StopTether();
}
}
« no previous file with comments | « no previous file | chromeos/components/tether/initializer.h » ('j') | chromeos/components/tether/initializer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698