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