OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_SIGNIN_SIGNIN_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ |
6 #define CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ | 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ |
7 | 7 |
8 #include "chrome/browser/api/sync/profile_sync_service_observer.h" | 8 #include "chrome/browser/api/sync/profile_sync_service_observer.h" |
9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // | 45 // |
46 // ProfileSyncService - Provides the external API for interacting with the | 46 // ProfileSyncService - Provides the external API for interacting with the |
47 // sync framework. Listens for notifications from the TokenService to know | 47 // sync framework. Listens for notifications from the TokenService to know |
48 // when to startup sync, and provides an Observer interface to notify the UI | 48 // when to startup sync, and provides an Observer interface to notify the UI |
49 // layer of changes in sync state so they can be reflected in the UI. | 49 // layer of changes in sync state so they can be reflected in the UI. |
50 class SigninTracker : public ProfileSyncServiceObserver, | 50 class SigninTracker : public ProfileSyncServiceObserver, |
51 public content::NotificationObserver { | 51 public content::NotificationObserver { |
52 public: | 52 public: |
53 class Observer { | 53 class Observer { |
54 public: | 54 public: |
55 virtual ~Observer() { } | |
56 | |
57 // The GAIA credentials entered by the user have been validated. | 55 // The GAIA credentials entered by the user have been validated. |
58 virtual void GaiaCredentialsValid() = 0; | 56 virtual void GaiaCredentialsValid() = 0; |
59 | 57 |
60 // The signin attempt failed. If this is called after GaiaCredentialsValid() | 58 // The signin attempt failed. If this is called after GaiaCredentialsValid() |
61 // then it means there was an error launching one of the dependent services. | 59 // then it means there was an error launching one of the dependent services. |
62 virtual void SigninFailed(const GoogleServiceAuthError& error) = 0; | 60 virtual void SigninFailed(const GoogleServiceAuthError& error) = 0; |
63 | 61 |
64 // The signin attempt succeeded. | 62 // The signin attempt succeeded. |
65 virtual void SigninSuccess() = 0; | 63 virtual void SigninSuccess() = 0; |
66 }; | 64 }; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Set to true when SigninManager has validated our credentials. | 112 // Set to true when SigninManager has validated our credentials. |
115 bool credentials_valid_; | 113 bool credentials_valid_; |
116 | 114 |
117 // Used to listen to notifications from the SigninManager. | 115 // Used to listen to notifications from the SigninManager. |
118 content::NotificationRegistrar registrar_; | 116 content::NotificationRegistrar registrar_; |
119 | 117 |
120 DISALLOW_COPY_AND_ASSIGN(SigninTracker); | 118 DISALLOW_COPY_AND_ASSIGN(SigninTracker); |
121 }; | 119 }; |
122 | 120 |
123 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ | 121 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ |
OLD | NEW |