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_GAIA_INFO_UPDATE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ |
6 #define CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ | 6 #define CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // Updates the GAIA info for the profile associated with this instance. | 29 // Updates the GAIA info for the profile associated with this instance. |
30 virtual void Update(); | 30 virtual void Update(); |
31 | 31 |
32 // Checks if downloading GAIA info for the given profile is allowed. | 32 // Checks if downloading GAIA info for the given profile is allowed. |
33 static bool ShouldUseGAIAProfileInfo(Profile* profile); | 33 static bool ShouldUseGAIAProfileInfo(Profile* profile); |
34 | 34 |
35 // Register prefs for a profile. | 35 // Register prefs for a profile. |
36 static void RegisterUserPrefs(PrefService* prefs); | 36 static void RegisterUserPrefs(PrefService* prefs); |
37 | 37 |
38 // ProfileDownloaderDelegate: | 38 // ProfileDownloaderDelegate: |
39 virtual int GetDesiredImageSideLength() OVERRIDE; | 39 virtual int GetDesiredImageSideLength() const OVERRIDE; |
40 virtual Profile* GetBrowserProfile() OVERRIDE; | 40 virtual Profile* GetBrowserProfile() OVERRIDE; |
41 virtual bool ShouldUseOAuthRefreshToken() OVERRIDE; | 41 virtual bool ShouldUseOAuthRefreshToken() const OVERRIDE; |
| 42 virtual std::string GetCachedPictureURL() const OVERRIDE; |
42 virtual void OnDownloadComplete(ProfileDownloader* downloader, | 43 virtual void OnDownloadComplete(ProfileDownloader* downloader, |
43 bool success) OVERRIDE; | 44 bool success) OVERRIDE; |
44 | 45 |
45 private: | 46 private: |
46 FRIEND_TEST_ALL_PREFIXES(GAIAInfoUpdateServiceTest, ScheduleUpdate); | 47 FRIEND_TEST_ALL_PREFIXES(GAIAInfoUpdateServiceTest, ScheduleUpdate); |
47 | 48 |
48 // content::NotificationObserver: | 49 // content::NotificationObserver: |
49 virtual void Observe(int type, | 50 virtual void Observe(int type, |
50 const content::NotificationSource& source, | 51 const content::NotificationSource& source, |
51 const content::NotificationDetails& details) OVERRIDE; | 52 const content::NotificationDetails& details) OVERRIDE; |
52 | 53 |
53 | 54 |
54 void OnUsernameChanged(); | 55 void OnUsernameChanged(); |
55 void ScheduleNextUpdate(); | 56 void ScheduleNextUpdate(); |
56 | 57 |
57 Profile* profile_; | 58 Profile* profile_; |
58 scoped_ptr<ProfileDownloader> profile_image_downloader_; | 59 scoped_ptr<ProfileDownloader> profile_image_downloader_; |
59 StringPrefMember username_pref_; | 60 StringPrefMember username_pref_; |
60 base::Time last_updated_; | 61 base::Time last_updated_; |
61 base::OneShotTimer<GAIAInfoUpdateService> timer_; | 62 base::OneShotTimer<GAIAInfoUpdateService> timer_; |
62 | 63 |
63 DISALLOW_COPY_AND_ASSIGN(GAIAInfoUpdateService); | 64 DISALLOW_COPY_AND_ASSIGN(GAIAInfoUpdateService); |
64 }; | 65 }; |
65 | 66 |
66 #endif // CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ | 67 #endif // CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ |
OLD | NEW |