| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_DOWNLOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_DOWNLOADER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_DOWNLOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_DOWNLOADER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 30 UserImageDownloader(const std::string& username, | 30 UserImageDownloader(const std::string& username, |
| 31 const std::string& auth_token); | 31 const std::string& auth_token); |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // It's a reference counted object, so destructor is private. | 34 // It's a reference counted object, so destructor is private. |
| 35 ~UserImageDownloader(); | 35 ~UserImageDownloader(); |
| 36 | 36 |
| 37 // Overriden from URLFetcher::Delegate: | 37 // Overriden from URLFetcher::Delegate: |
| 38 virtual void OnURLFetchComplete(const URLFetcher* source, | 38 virtual void OnURLFetchComplete(const URLFetcher* source, |
| 39 const GURL& url, | 39 const GURL& url, |
| 40 const URLRequestStatus& status, | 40 const net::URLRequestStatus& status, |
| 41 int response_code, | 41 int response_code, |
| 42 const ResponseCookies& cookies, | 42 const ResponseCookies& cookies, |
| 43 const std::string& data); | 43 const std::string& data); |
| 44 | 44 |
| 45 // Overriden from ImageDecoder::Delegate: | 45 // Overriden from ImageDecoder::Delegate: |
| 46 virtual void OnImageDecoded(const SkBitmap& decoded_image); | 46 virtual void OnImageDecoded(const SkBitmap& decoded_image); |
| 47 | 47 |
| 48 // Parses received JSON data looking for user image url. | 48 // Parses received JSON data looking for user image url. |
| 49 // If succeeded, returns true and stores the url in |image_url| parameter. | 49 // If succeeded, returns true and stores the url in |image_url| parameter. |
| 50 // Otherwise, returns false. | 50 // Otherwise, returns false. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 76 // Authentication token to use for image download. | 76 // Authentication token to use for image download. |
| 77 std::string auth_token_; | 77 std::string auth_token_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(UserImageDownloader); | 79 DISALLOW_COPY_AND_ASSIGN(UserImageDownloader); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace chromeos | 82 } // namespace chromeos |
| 83 | 83 |
| 84 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_DOWNLOADER_H_ | 84 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_DOWNLOADER_H_ |
| 85 | 85 |
| OLD | NEW |