| 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 20 matching lines...) Expand all Loading... |
| 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() OVERRIDE; |
| 40 virtual Profile* GetBrowserProfile() OVERRIDE; | 40 virtual Profile* GetBrowserProfile() OVERRIDE; |
| 41 virtual bool ShouldUseOAuthRefreshToken() OVERRIDE; |
| 41 virtual void OnDownloadComplete(ProfileDownloader* downloader, | 42 virtual void OnDownloadComplete(ProfileDownloader* downloader, |
| 42 bool success) OVERRIDE; | 43 bool success) OVERRIDE; |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 FRIEND_TEST_ALL_PREFIXES(GAIAInfoUpdateServiceTest, ScheduleUpdate); | 46 FRIEND_TEST_ALL_PREFIXES(GAIAInfoUpdateServiceTest, ScheduleUpdate); |
| 46 | 47 |
| 47 // content::NotificationObserver: | 48 // content::NotificationObserver: |
| 48 virtual void Observe(int type, | 49 virtual void Observe(int type, |
| 49 const content::NotificationSource& source, | 50 const content::NotificationSource& source, |
| 50 const content::NotificationDetails& details) OVERRIDE; | 51 const content::NotificationDetails& details) OVERRIDE; |
| 51 | 52 |
| 52 | 53 |
| 53 void OnUsernameChanged(); | 54 void OnUsernameChanged(); |
| 54 void ScheduleNextUpdate(); | 55 void ScheduleNextUpdate(); |
| 55 | 56 |
| 56 Profile* profile_; | 57 Profile* profile_; |
| 57 scoped_ptr<ProfileDownloader> profile_image_downloader_; | 58 scoped_ptr<ProfileDownloader> profile_image_downloader_; |
| 58 StringPrefMember username_pref_; | 59 StringPrefMember username_pref_; |
| 59 base::Time last_updated_; | 60 base::Time last_updated_; |
| 60 base::OneShotTimer<GAIAInfoUpdateService> timer_; | 61 base::OneShotTimer<GAIAInfoUpdateService> timer_; |
| 61 | 62 |
| 62 DISALLOW_COPY_AND_ASSIGN(GAIAInfoUpdateService); | 63 DISALLOW_COPY_AND_ASSIGN(GAIAInfoUpdateService); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 #endif // CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ | 66 #endif // CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ |
| OLD | NEW |