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 browser profile associated with this download request. | 27 // Returns the browser profile associated with this download request. |
28 virtual Profile* GetBrowserProfile() = 0; | 28 virtual Profile* GetBrowserProfile() = 0; |
29 | 29 |
30 // Checks if we should use a OAuth refresh token. Currently this is only used | |
31 // by the Chrome Browser. | |
32 virtual bool GetShouldUseOAuthRefreshToken() = 0; | |
33 | |
34 // Called when the download is complete. On success delegate should query | 30 // Called when the download is complete. On success delegate should query |
35 // the downloader for values. | 31 // the downloader for values. |
36 virtual void OnDownloadComplete(ProfileDownloader* downloader, | 32 virtual void OnDownloadComplete(ProfileDownloader* downloader, |
37 bool success) = 0; | 33 bool success) = 0; |
38 }; | 34 }; |
39 | 35 |
40 #endif // CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_ | 36 #endif // CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_ |
OLD | NEW |