OLD | NEW |
---|---|
1 // Copyright (c) 2011 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_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_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" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 | 13 |
14 class Profile; | 14 class Profile; |
15 class ProfileDownloader; | 15 class ProfileDownloader; |
16 | 16 |
17 // Reports on success or failure of Profile download. It is OK to delete the | 17 // Reports on success or failure of Profile download. It is OK to delete the |
18 // |ProfileImageDownloader| instance in any of these handlers. | 18 // |ProfileImageDownloader| instance in any of these handlers. |
19 class ProfileDownloaderDelegate { | 19 class ProfileDownloaderDelegate { |
20 public: | 20 public: |
21 virtual ~ProfileDownloaderDelegate() {} | 21 virtual ~ProfileDownloaderDelegate() {} |
22 | 22 |
23 // Returns the desired side length of the profile image. If 0, returns image | 23 // Returns the desired side length of the profile image. If 0, returns image |
24 // of the originally uploaded size. | 24 // of the originally uploaded size. |
25 virtual int GetDesiredImageSideLength() = 0; | 25 virtual int GetDesiredImageSideLength() = 0; |
26 | 26 |
27 // Returns the cached URL. If the cache URL matches the new image URL | |
28 // the image will not be downloaded. | |
Ivan Korotkov
2011/11/30 14:35:44
Please document what to return when there is no ca
sail
2011/11/30 19:00:23
Done.
| |
29 virtual std::string GetCachedPictureURL() = 0; | |
Ivan Korotkov
2011/11/30 14:35:44
I think that this and the previous getter should b
sail
2011/11/30 19:00:23
Done.
| |
30 | |
27 // Returns the browser profile associated with this download request. | 31 // Returns the browser profile associated with this download request. |
28 virtual Profile* GetBrowserProfile() = 0; | 32 virtual Profile* GetBrowserProfile() = 0; |
29 | 33 |
30 // Called when the download is complete. On success delegate should query | 34 // Called when the download is complete. On success delegate should query |
31 // the downloader for values. | 35 // the downloader for values. |
32 virtual void OnDownloadComplete(ProfileDownloader* downloader, | 36 virtual void OnDownloadComplete(ProfileDownloader* downloader, |
33 bool success) = 0; | 37 bool success) = 0; |
34 }; | 38 }; |
35 | 39 |
36 #endif // CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_ | 40 #endif // CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_ |
OLD | NEW |