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

Unified Diff: chromeos/network/auto_connect_handler.cc

Issue 1415683013: Let AutoConnectHandler wait for user policy before disconnecting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/network/auto_connect_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/auto_connect_handler.cc
diff --git a/chromeos/network/auto_connect_handler.cc b/chromeos/network/auto_connect_handler.cc
index edb8c6dd94d54b68f082eb49db27f394ede28674..d7a64a220ce4c898c98f316bcbfc5b632eba5d90 100644
--- a/chromeos/network/auto_connect_handler.cc
+++ b/chromeos/network/auto_connect_handler.cc
@@ -100,10 +100,12 @@ void AutoConnectHandler::PoliciesChanged(const std::string& userhash) {
}
void AutoConnectHandler::PoliciesApplied(const std::string& userhash) {
- if (userhash.empty())
+ if (userhash.empty()) {
device_policy_applied_ = true;
- else
+ } else {
user_policy_applied_ = true;
+ DisconnectIfPolicyRequires();
+ }
// Request to connect to the best network only if there is at least one
// managed network. Otherwise only process existing requests.
@@ -194,7 +196,8 @@ void AutoConnectHandler::CheckBestConnection() {
}
void AutoConnectHandler::DisconnectIfPolicyRequires() {
- if (applied_autoconnect_policy_ || !LoginState::Get()->IsUserLoggedIn())
+ if (applied_autoconnect_policy_ || !LoginState::Get()->IsUserLoggedIn() ||
+ !user_policy_applied_)
return;
stevenjb 2015/11/09 18:56:10 Add {}
fqj 2015/11/09 19:00:50 Done.
const base::DictionaryValue* global_network_config =
« no previous file with comments | « no previous file | chromeos/network/auto_connect_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698