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

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: fix tests 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..60cb61cfdd2d1ade463a2f0de8232f28084f018d 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();
stevenjb 2015/11/09 17:42:53 I assume device policy is guaranteed to already be
cschuet (SLOW) 2015/11/09 17:44:38 I don't think that is the case. Managed users can
stevenjb 2015/11/09 18:05:51 I see. So what happens if a device policy is updat
fqj 2015/11/09 18:26:20 then PoliciesChanged will be called, which will ca
stevenjb 2015/11/09 18:43:50 I see. It looks like we never execute DisconnectIf
cschuet (SLOW) 2015/11/09 18:54:43 Qijian, please update the comments in the header f
+ }
// Request to connect to the best network only if there is at least one
// managed network. Otherwise only process existing requests.
@@ -197,6 +199,9 @@ void AutoConnectHandler::DisconnectIfPolicyRequires() {
if (applied_autoconnect_policy_ || !LoginState::Get()->IsUserLoggedIn())
return;
+ if (!user_policy_applied_)
+ return;
stevenjb 2015/11/09 18:43:50 Merge this if() with the one above; I missed the !
fqj 2015/11/09 18:50:08 Done.
+
const base::DictionaryValue* global_network_config =
managed_configuration_handler_->GetGlobalConfigFromPolicy(
std::string() /* no username hash, device policy */);
« 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