| Index: chrome/browser/chromeos/login/user_controller.cc
|
| diff --git a/chrome/browser/chromeos/login/user_controller.cc b/chrome/browser/chromeos/login/user_controller.cc
|
| index b88ea60655b7a3b28743dc842e674b47c9e99bab..55aad328f152f71185faa8515ae681db0d23c026 100644
|
| --- a/chrome/browser/chromeos/login/user_controller.cc
|
| +++ b/chrome/browser/chromeos/login/user_controller.cc
|
| @@ -8,6 +8,7 @@
|
| #include <vector>
|
|
|
| #include "base/utf_string_conversions.h"
|
| +#include "chrome/browser/chromeos/cros_settings.h"
|
| #include "chrome/browser/chromeos/login/existing_user_view.h"
|
| #include "chrome/browser/chromeos/login/guest_user_view.h"
|
| #include "chrome/browser/chromeos/login/helper.h"
|
| @@ -16,7 +17,6 @@
|
| #include "chrome/browser/chromeos/login/username_view.h"
|
| #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h"
|
| #include "chrome/browser/chromeos/login/wizard_controller.h"
|
| -#include "chrome/browser/chromeos/user_cros_settings_provider.h"
|
| #include "grit/generated_resources.h"
|
| #include "grit/theme_resources.h"
|
| #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h"
|
| @@ -55,6 +55,16 @@ void CloseWindow(views::Widget* window) {
|
| window->CloseNow();
|
| }
|
|
|
| +// Helper function to initialize the |is_owner_| const field of UserController.
|
| +bool VerifyOwnership(const std::string& email) {
|
| + // Empty owner string means that owner hasn't been cached yet, not that owner
|
| + // has an empty email.
|
| + // TODO(pastarmovj): Consider switching to TrustedGet here.
|
| + std::string owner;
|
| + return CrosSettings::Get()->GetString(kDeviceOwner, &owner) &&
|
| + (email == owner);
|
| +}
|
| +
|
| } // namespace
|
|
|
| // WidgetDelegate implementation for the Widget used for the controls.
|
| @@ -125,9 +135,7 @@ UserController::UserController(Delegate* delegate,
|
| is_user_selected_(false),
|
| is_new_user_(false),
|
| is_guest_(false),
|
| - // Empty 'cached_owner()' means that owner hasn't been cached yet, not
|
| - // that owner has an empty email.
|
| - is_owner_(user.email() == UserCrosSettingsProvider::cached_owner()),
|
| + is_owner_(VerifyOwnership(user.email())),
|
| show_name_tooltip_(false),
|
| user_(user),
|
| delegate_(delegate),
|
|
|