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

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

Issue 8772055: Use Google Plus API to get profile information (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux build Created 9 years 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 | « no previous file | 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 4e15a47fa5d7ad215477463bb74f116a6c16c575..0395ab4a2bd225be7a9761196f5947e48678fe3a 100644
--- a/chrome/browser/profiles/profile_downloader.h
+++ b/chrome/browser/profiles/profile_downloader.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
#include "chrome/browser/image_decoder.h"
@@ -62,6 +63,10 @@ class ProfileDownloader : public content::URLFetcherDelegate,
virtual std::string GetProfilePictureURL() const;
private:
+ friend class ProfileDownloaderTest;
+ FRIEND_TEST_ALL_PREFIXES(ProfileDownloaderTest, ParseData);
+ FRIEND_TEST_ALL_PREFIXES(ProfileDownloaderTest, DefaultURL);
+
// Overriden from content::URLFetcherDelegate:
virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE;
@@ -79,14 +84,16 @@ class ProfileDownloader : public content::URLFetcherDelegate,
virtual void OnGetTokenSuccess(const std::string& access_token) OVERRIDE;
virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) OVERRIDE;
- // Parses the entry response from Picasa and gets the nick name and
- // and profile image URL. Returns false to indicate a parsing error.
- bool GetProfileNickNameAndImageURL(const std::string& data,
- string16* nick_name,
- std::string* url) const;
+ // Parses the entry response and gets the name and and profile image URL.
+ // |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);
// Returns true if the image url is url of the default profile picture.
- bool IsDefaultProfileImageURL(const std::string& url) const;
+ static bool IsDefaultProfileImageURL(const std::string& url);
// Issues the first request to get user profile image.
void StartFetchingImage();
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698