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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 public: | 54 public: |
55 // The GAIA credentials entered by the user have been validated. | 55 // The GAIA credentials entered by the user have been validated. |
56 virtual void GaiaCredentialsValid() = 0; | 56 virtual void GaiaCredentialsValid() = 0; |
57 | 57 |
58 // The signin attempt failed. If this is called after GaiaCredentialsValid() | 58 // The signin attempt failed. If this is called after GaiaCredentialsValid() |
59 // 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. |
60 virtual void SigninFailed(const GoogleServiceAuthError& error) = 0; | 60 virtual void SigninFailed(const GoogleServiceAuthError& error) = 0; |
61 | 61 |
62 // The signin attempt succeeded. | 62 // The signin attempt succeeded. |
63 virtual void SigninSuccess() = 0; | 63 virtual void SigninSuccess() = 0; |
| 64 |
| 65 protected: |
| 66 virtual ~Observer() { } |
64 }; | 67 }; |
65 | 68 |
66 // The various states the login process can be in. | 69 // The various states the login process can be in. |
67 enum LoginState { | 70 enum LoginState { |
68 WAITING_FOR_GAIA_VALIDATION, | 71 WAITING_FOR_GAIA_VALIDATION, |
69 SERVICES_INITIALIZING, | 72 SERVICES_INITIALIZING, |
70 SIGNIN_COMPLETE | 73 SIGNIN_COMPLETE |
71 }; | 74 }; |
72 | 75 |
73 // Creates a SigninTracker that tracks the signin status on the passed | 76 // Creates a SigninTracker that tracks the signin status on the passed |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // Set to true when SigninManager has validated our credentials. | 115 // Set to true when SigninManager has validated our credentials. |
113 bool credentials_valid_; | 116 bool credentials_valid_; |
114 | 117 |
115 // Used to listen to notifications from the SigninManager. | 118 // Used to listen to notifications from the SigninManager. |
116 content::NotificationRegistrar registrar_; | 119 content::NotificationRegistrar registrar_; |
117 | 120 |
118 DISALLOW_COPY_AND_ASSIGN(SigninTracker); | 121 DISALLOW_COPY_AND_ASSIGN(SigninTracker); |
119 }; | 122 }; |
120 | 123 |
121 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ | 124 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ |
OLD | NEW |