Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3164)

Unified Diff: chrome/browser/chromeos/login/user.cc

Issue 23095006: If user profile doesn't contain language setting, default to his Google account settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment on "list of preferred languages". Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/user.cc
diff --git a/chrome/browser/chromeos/login/user.cc b/chrome/browser/chromeos/login/user.cc
index 5e47a5afd19005ad09e8e695bb193085f00ed136..ce5a1c72f3c70dcbc2e1351331e66c99b29b8b7d 100644
--- a/chrome/browser/chromeos/login/user.cc
+++ b/chrome/browser/chromeos/login/user.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/chromeos/login/default_user_images.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "grit/theme_resources.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
namespace chromeos {
@@ -202,11 +203,18 @@ User::User(const std::string& email)
image_is_stub_(false),
image_is_loading_(false),
is_logged_in_(false),
- is_active_(false) {
+ is_active_(false),
+ profile_is_created_(false) {
}
User::~User() {}
+void User::SetAccountLocale(const std::string& raw_account_locale) {
+ account_locale_.reset(new std::string);
+ // Ignore result
+ l10n_util::CheckAndResolveLocale(raw_account_locale, account_locale_.get());
+}
+
void User::SetImage(const UserImage& user_image, int image_index) {
user_image_ = user_image;
image_index_ = image_index;
@@ -300,4 +308,21 @@ User::UserType PublicAccountUser::GetType() const {
return USER_TYPE_PUBLIC_ACCOUNT;
}
+bool User::has_account() const {
+ COMPILE_ASSERT(NUM_USER_TYPES == 6, num_user_types_unexpected);
+ switch (GetType()) {
+ case USER_TYPE_REGULAR:
+ return true;
+ case USER_TYPE_GUEST:
+ case USER_TYPE_RETAIL_MODE:
+ case USER_TYPE_PUBLIC_ACCOUNT:
+ case USER_TYPE_LOCALLY_MANAGED:
+ case USER_TYPE_KIOSK_APP:
+ return false;
+ default:
+ NOTREACHED();
+ }
+ return false;
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698