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

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: 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/profiles/profile_downloader.h
diff --git a/chrome/browser/profiles/profile_downloader.h b/chrome/browser/profiles/profile_downloader.h
index 8c5c4658bcf9795d19301b0f9b2bf9afd744f60f..7260d3c788af4614b10d0f63e86b92311f95445b 100644
--- a/chrome/browser/profiles/profile_downloader.h
+++ b/chrome/browser/profiles/profile_downloader.h
@@ -50,6 +50,9 @@ class ProfileDownloader : public net::URLFetcherDelegate,
// "Pat Smith".
virtual string16 GetProfileFullName() 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.
@@ -86,14 +89,14 @@ class ProfileDownloader : public net::URLFetcherDelegate,
virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) OVERRIDE;
- // Parses the entry response and gets the name and and profile image URL.
+ // 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 GetProfileNameAndImageURL(const std::string& data,
- string16* nick_name,
- std::string* url,
- int image_size);
-
+ static bool ParseProfileJSON(const std::string& data,
+ string16* nick_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);
@@ -113,6 +116,7 @@ class ProfileDownloader : public net::URLFetcherDelegate,
scoped_ptr<net::URLFetcher> profile_image_fetcher_;
scoped_ptr<OAuth2TokenService::Request> oauth2_access_token_request_;
string16 profile_full_name_;
+ std::string profile_locale_;
SkBitmap profile_picture_;
PictureStatus picture_status_;
std::string picture_url_;

Powered by Google App Engine
This is Rietveld 408576698