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..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 = |