| 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 "content/public/browser/notification_observer.h" | 8 #include "content/public/browser/notification_observer.h" |
| 9 #include "content/public/browser/notification_registrar.h" | 9 #include "content/public/browser/notification_registrar.h" |
| 10 #include "content/public/browser/notification_types.h" | 10 #include "content/public/browser/notification_types.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // LoginUIService - Our desktop UI flows rely on having only a single login flow | 32 // LoginUIService - Our desktop UI flows rely on having only a single login flow |
| 33 // visible to the user at once. This is achieved via LoginUIService | 33 // visible to the user at once. This is achieved via LoginUIService |
| 34 // (a BrowserContextKeyedService that keeps track of the currently visible | 34 // (a BrowserContextKeyedService that keeps track of the currently visible |
| 35 // login UI). | 35 // login UI). |
| 36 // | 36 // |
| 37 // SigninManager - Records the currently-logged-in user and handles all | 37 // SigninManager - Records the currently-logged-in user and handles all |
| 38 // interaction with the GAIA backend during the signin process. Unlike | 38 // interaction with the GAIA backend during the signin process. Unlike |
| 39 // SigninTracker, SigninManager only knows about the GAIA login state and is | 39 // SigninTracker, SigninManager only knows about the GAIA login state and is |
| 40 // not aware of the state of any signed in services. | 40 // not aware of the state of any signed in services. |
| 41 // | 41 // |
| 42 // TokenService - Uses credentials provided by SigninManager to generate tokens | |
| 43 // for all signed-in services in Chrome. | |
| 44 // | |
| 45 // OAuth2TokenService - Maintains and manages OAuth2 tokens for the accounts | 42 // OAuth2TokenService - Maintains and manages OAuth2 tokens for the accounts |
| 46 // connected to this profile. | 43 // connected to this profile. |
| 47 // | 44 // |
| 48 // ProfileSyncService - Provides the external API for interacting with the | 45 // ProfileSyncService - Provides the external API for interacting with the |
| 49 // sync framework. Listens for notifications from the TokenService to know | 46 // sync framework. Listens for notifications for tokens to know when to startup |
| 50 // when to startup sync, and provides an Observer interface to notify the UI | 47 // sync, and provides an Observer interface to notify the UI layer of changes |
| 51 // layer of changes in sync state so they can be reflected in the UI. | 48 // in sync state so they can be reflected in the UI. |
| 52 class SigninTracker : public content::NotificationObserver, | 49 class SigninTracker : public content::NotificationObserver, |
| 53 public OAuth2TokenService::Observer { | 50 public OAuth2TokenService::Observer { |
| 54 public: | 51 public: |
| 55 class Observer { | 52 class Observer { |
| 56 public: | 53 public: |
| 57 // The signin attempt failed, and the cause is passed in |error|. | 54 // The signin attempt failed, and the cause is passed in |error|. |
| 58 virtual void SigninFailed(const GoogleServiceAuthError& error) = 0; | 55 virtual void SigninFailed(const GoogleServiceAuthError& error) = 0; |
| 59 | 56 |
| 60 // The signin attempt succeeded. | 57 // The signin attempt succeeded. |
| 61 virtual void SigninSuccess() = 0; | 58 virtual void SigninSuccess() = 0; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 86 // Weak pointer to the observer we call when the signin state changes. | 83 // Weak pointer to the observer we call when the signin state changes. |
| 87 Observer* observer_; | 84 Observer* observer_; |
| 88 | 85 |
| 89 // Used to listen to notifications from the SigninManager. | 86 // Used to listen to notifications from the SigninManager. |
| 90 content::NotificationRegistrar registrar_; | 87 content::NotificationRegistrar registrar_; |
| 91 | 88 |
| 92 DISALLOW_COPY_AND_ASSIGN(SigninTracker); | 89 DISALLOW_COPY_AND_ASSIGN(SigninTracker); |
| 93 }; | 90 }; |
| 94 | 91 |
| 95 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ | 92 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_ |
| OLD | NEW |