| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ANDROID_SIGNIN_GOOGLE_AUTO_LOGIN_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_SIGNIN_GOOGLE_AUTO_LOGIN_HELPER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_SIGNIN_GOOGLE_AUTO_LOGIN_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_SIGNIN_GOOGLE_AUTO_LOGIN_HELPER_H_ |
| 7 | 7 |
| 8 #include <deque> |
| 9 |
| 8 #include "chrome/browser/signin/ubertoken_fetcher.h" | 10 #include "chrome/browser/signin/ubertoken_fetcher.h" |
| 9 #include "google_apis/gaia/gaia_auth_consumer.h" | 11 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 10 | 12 |
| 11 class GaiaAuthFetcher; | 13 class GaiaAuthFetcher; |
| 12 class Profile; | 14 class Profile; |
| 13 | 15 |
| 14 // Logs in the current signed in user into Google services. Populates the cookie | 16 // Logs in the current signed in user into Google services. Populates the cookie |
| 15 // jar with Google credentials of the signed in user. | 17 // jar with Google credentials of the signed in user. |
| 16 class GoogleAutoLoginHelper : public GaiaAuthConsumer, | 18 class GoogleAutoLoginHelper : public GaiaAuthConsumer, |
| 17 public UbertokenConsumer { | 19 public UbertokenConsumer { |
| 18 public: | 20 public: |
| 19 explicit GoogleAutoLoginHelper(Profile* profile); | 21 explicit GoogleAutoLoginHelper(Profile* profile); |
| 20 virtual ~GoogleAutoLoginHelper(); | 22 virtual ~GoogleAutoLoginHelper(); |
| 21 | 23 |
| 22 void LogIn(); | 24 void LogIn(); |
| 23 void LogIn(const std::string& account_id); | 25 void LogIn(const std::string& account_id); |
| 26 void LogIn(const std::deque<std::string>& account_id); |
| 24 | 27 |
| 25 // Overridden from GaiaAuthConsumer. | 28 // Overridden from GaiaAuthConsumer. |
| 26 virtual void OnMergeSessionSuccess(const std::string& data) OVERRIDE; | 29 virtual void OnMergeSessionSuccess(const std::string& data) OVERRIDE; |
| 27 virtual void OnMergeSessionFailure(const GoogleServiceAuthError& error) | 30 virtual void OnMergeSessionFailure(const GoogleServiceAuthError& error) |
| 28 OVERRIDE; | 31 OVERRIDE; |
| 29 | 32 |
| 30 // Overridden from UbertokenConsumer. | 33 // Overridden from UbertokenConsumer. |
| 31 virtual void OnUbertokenSuccess(const std::string& token) OVERRIDE; | 34 virtual void OnUbertokenSuccess(const std::string& token) OVERRIDE; |
| 32 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) OVERRIDE; | 35 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) OVERRIDE; |
| 33 | 36 |
| 34 private: | 37 private: |
| 35 Profile* profile_; | 38 Profile* profile_; |
| 36 scoped_ptr<GaiaAuthFetcher> gaia_auth_fetcher_; | 39 scoped_ptr<GaiaAuthFetcher> gaia_auth_fetcher_; |
| 37 scoped_ptr<UbertokenFetcher> uber_token_fetcher_; | 40 scoped_ptr<UbertokenFetcher> uber_token_fetcher_; |
| 41 std::deque<std::string> accounts_; |
| 38 | 42 |
| 39 DISALLOW_COPY_AND_ASSIGN(GoogleAutoLoginHelper); | 43 DISALLOW_COPY_AND_ASSIGN(GoogleAutoLoginHelper); |
| 40 }; | 44 }; |
| 41 | 45 |
| 42 #endif // CHROME_BROWSER_ANDROID_SIGNIN_GOOGLE_AUTO_LOGIN_HELPER_H_ | 46 #endif // CHROME_BROWSER_ANDROID_SIGNIN_GOOGLE_AUTO_LOGIN_HELPER_H_ |
| OLD | NEW |