Chromium Code Reviews| 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 069cdc98396eb3f03d1fe9a15478750a6fed19e0..6b7b3e09f6e86ab05cab4317d38ff7b26f62e831 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())), |
|
Mattias Nissler (ping if slow)
2011/09/21 11:12:59
same comment as before regarding the inaccuracy of
pastarmovj
2011/09/23 15:19:32
I already have a todo to consider switching this t
|
| show_name_tooltip_(false), |
| user_(user), |
| delegate_(delegate), |