| Index: components/arc/net/arc_net_host_impl.cc
|
| diff --git a/components/arc/net/arc_net_host_impl.cc b/components/arc/net/arc_net_host_impl.cc
|
| index b6f497d0b1902e9d9fb5863bf5c1a9ddbbb7af7c..4a13761f425823eb0493d3cf633676c1642a3fed 100644
|
| --- a/components/arc/net/arc_net_host_impl.cc
|
| +++ b/components/arc/net/arc_net_host_impl.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/posix/eintr_wrapper.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "base/time/time.h"
|
| +#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
|
| #include "chromeos/login/login_state.h"
|
| #include "chromeos/network/managed_network_configuration_handler.h"
|
| #include "chromeos/network/network_connection_handler.h"
|
| @@ -43,10 +44,12 @@ chromeos::NetworkConnectionHandler* GetNetworkConnectionHandler() {
|
| }
|
|
|
| bool IsDeviceOwner() {
|
| - // Check whether the logged-in Chrome OS user is allowed to add or
|
| - // remove WiFi networks.
|
| - return chromeos::LoginState::Get()->GetLoggedInUserType() ==
|
| - chromeos::LoginState::LOGGED_IN_USER_OWNER;
|
| + // Check whether the logged-in Chrome OS user is allowed to add or remove WiFi
|
| + // networks. The user account state changes immediately after boot. There is a
|
| + // small window when this may return an incorrect state. However, after things
|
| + // settle down this is guranteed to reflect the correct user account state.
|
| + return chromeos::ChromeUserManager::Get()->GetOwnerAccountId() ==
|
| + chromeos::ChromeUserManager::Get()->GetActiveUser()->GetAccountId();
|
| }
|
|
|
| std::string GetStringFromOncDictionary(const base::DictionaryValue* dict,
|
|
|