1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_
10 #include "base/basictypes.h"
11 #include "base/string16.h"
14 class ProfileDownloader
;
16 // Reports on success or failure of Profile download. It is OK to delete the
17 // |ProfileImageDownloader| instance in any of these handlers.
18 class ProfileDownloaderDelegate
{
20 virtual ~ProfileDownloaderDelegate() {}
22 // Whether the delegate need profile picture to be downloaded.
23 virtual bool NeedsProfilePicture() const = 0;
25 // Returns the desired side length of the profile image. If 0, returns image
26 // of the originally uploaded size.
27 virtual int GetDesiredImageSideLength() const = 0;
29 // Returns the cached URL. If the cache URL matches the new image URL
30 // the image will not be downloaded. Return an empty string when there is no
32 virtual std::string
GetCachedPictureURL() const = 0;
34 // Returns the browser profile associated with this download request.
35 virtual Profile
* GetBrowserProfile() = 0;
37 // Called when the profile download has completed successfully. Delegate can
38 // query the downloader for the picture and full name.
39 virtual void OnProfileDownloadSuccess(ProfileDownloader
* downloader
) = 0;
41 // Called when the profile download has failed.
42 virtual void OnProfileDownloadFailure(ProfileDownloader
* downloader
) = 0;
45 #endif // CHROME_BROWSER_PROFILES_PROFILE_DOWNLOADER_DELEGATE_H_