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

Unified Diff: chrome/browser/profiles/profile_downloader.h

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: Fix tests. 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
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | chrome/browser/profiles/profile_downloader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_downloader.h
diff --git a/chrome/browser/profiles/profile_downloader.h b/chrome/browser/profiles/profile_downloader.h
index 952fd2e39b3bf7b733aa266192686f4ae8c6d3c6..326331c650431d6fe8eab9761f8bafc4efc44fb9 100644
--- a/chrome/browser/profiles/profile_downloader.h
+++ b/chrome/browser/profiles/profile_downloader.h
@@ -54,6 +54,9 @@ class ProfileDownloader : public net::URLFetcherDelegate,
// if the name is "Pat Smith", the given name is "Pat".
virtual string16 GetProfileGivenName() const;
+ // On successful download this returns G+ locale preference of the user.
+ virtual std::string GetProfileLocale() const;
+
// On successful download this returns the profile picture of the user.
// For users with no profile picture set (that is, they have the default
// profile picture) this will return an Null bitmap.
@@ -90,15 +93,15 @@ class ProfileDownloader : public net::URLFetcherDelegate,
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) OVERRIDE;
- // Parses the entry response and gets the full name, the given name,
- // and profile image URL. |data| should be the JSON formatted data returned
- // by the response. Returns false to indicate a parsing error.
- static bool GetProfileNameAndImageURL(const std::string& data,
- string16* full_name,
- string16* given_name,
- std::string* url,
- int image_size);
-
+ // Parses the entry response and gets the name, profile image URL and locale.
+ // |data| should be the JSON formatted data return by the response.
+ // Returns false to indicate a parsing error.
+ static bool ParseProfileJSON(const std::string& data,
+ string16* full_name,
+ string16* given_name,
+ std::string* url,
+ int image_size,
+ std::string* profile_locale);
// Returns true if the image url is url of the default profile picture.
static bool IsDefaultProfileImageURL(const std::string& url);
@@ -119,6 +122,7 @@ class ProfileDownloader : public net::URLFetcherDelegate,
scoped_ptr<OAuth2TokenService::Request> oauth2_access_token_request_;
string16 profile_full_name_;
string16 profile_given_name_;
+ std::string profile_locale_;
SkBitmap profile_picture_;
PictureStatus picture_status_;
std::string picture_url_;
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | chrome/browser/profiles/profile_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698