Chromium Code Reviews| 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 */); |