summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/signin_manager.h
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-08 01:38:35 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-08 01:38:35 +0000
commit265d8c32bd4dbb4b1a142c8204b434a03e8a8c8f (patch)
tree105095d5eead4db62bbf60ed0b3f1d243b202e76 /chrome/browser/sync/signin_manager.h
parent8b20191a72da085319a68e4953e9f2b355218825 (diff)
downloadchromium_src-265d8c32bd4dbb4b1a142c8204b434a03e8a8c8f.zip
chromium_src-265d8c32bd4dbb4b1a142c8204b434a03e8a8c8f.tar.gz
chromium_src-265d8c32bd4dbb4b1a142c8204b434a03e8a8c8f.tar.bz2
Revert 58778 - New authorization framework for sync.
To quote chron's original patch (http://codereview.chromium.org/3148036/show) <blockquote> This patch removes: authenticator.cc, auth_watcher.cc removes calls to user_settings.cc, removes an authenticate PB request to the server, and moves token storage into the Chrome TokenService. This patch introduces the SigninManager, which is an interim solution for user management prior to moving the system into chrome. Other changes include removing the dependency on the sync backend to be running while the sync wizard is intially displayed. This means that the backend can be brought up in response to credentials becoming available. The backend now is always provided credentials on startup. If an auth error occurs, it propogates it up via a notification. Some event handlers were removed and streamlined for more straightforward sync system startup. </blockquote> BUG=51001, 50293, 35158 TEST=Unit tests && Start up sync, log in, log out, run with expired credentials, run with new gaia credentials, run with gaia credentials updated while system is syncing. Try logging in with incorrect username. Trigger CAPTCHA. Try logging out and in repeatedly. Check about:sync works. Try going offline and back online again. Expire gaia credentials and try renewing it with the UI dialog. Review URL: http://codereview.chromium.org/3305003 TBR=johnnyg@chromium.org Review URL: http://codereview.chromium.org/3310019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58782 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/signin_manager.h')
-rw-r--r--chrome/browser/sync/signin_manager.h81
1 files changed, 0 insertions, 81 deletions
diff --git a/chrome/browser/sync/signin_manager.h b/chrome/browser/sync/signin_manager.h
deleted file mode 100644
index a62514f..0000000
--- a/chrome/browser/sync/signin_manager.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// The signin manager encapsulates some functionality tracking
-// which user is signed in. When a user is signed in, a ClientLogin
-// request is run on their behalf. Auth tokens are fetched from Google
-// and the results are stored in the TokenService.
-
-#ifndef CHROME_BROWSER_SYNC_SIGNIN_MANAGER_H_
-#define CHROME_BROWSER_SYNC_SIGNIN_MANAGER_H_
-#pragma once
-
-#include <string>
-#include "base/logging.h"
-#include "base/scoped_ptr.h"
-#include "chrome/common/net/gaia/gaia_auth_consumer.h"
-#include "chrome/common/net/gaia/google_service_auth_error.h"
-
-class GaiaAuthenticator2;
-class Profile;
-class PrefService;
-
-// Details for the Notification type GOOGLE_SIGNIN_SUCCESSFUL.
-// A listener might use this to make note of a username / password
-// pair for encryption keys.
-struct GoogleServiceSigninSuccessDetails {
- GoogleServiceSigninSuccessDetails(const std::string& in_username,
- const std::string& in_password)
- : username(in_username),
- password(in_password) {}
- std::string username;
- std::string password;
-};
-
-class SigninManager : public GaiaAuthConsumer {
- public:
- // Call to register our prefs.
- static void RegisterUserPrefs(PrefService* user_prefs);
-
- // If user was signed in, load tokens from DB if available.
- void Initialize(Profile* profile);
-
- // If a user is signed in, this will return their name.
- // Otherwise, it will return an empty string.
- const std::string& GetUsername();
-
- // Sets the user name. Used for migrating credentials from previous system.
- void SetUsername(const std::string& username);
-
- // Attempt to sign in this user. If successful, set a preference indicating
- // the signed in user and send out a notification, then start fetching tokens
- // for the user.
- void StartSignIn(const std::string& username,
- const std::string& password,
- const std::string& login_token,
- const std::string& login_captcha);
- // Sign a user out, removing the preference, erasing all keys
- // associated with the user, and cancelling all auth in progress.
- void SignOut();
-
- // GaiaAuthConsumer
- virtual void OnClientLoginSuccess(const ClientLoginResult& result);
- virtual void OnClientLoginFailure(const GoogleServiceAuthError& error);
- virtual void OnIssueAuthTokenSuccess(const std::string& service,
- const std::string& auth_token) {
- NOTREACHED();
- }
- virtual void OnIssueAuthTokenFailure(const std::string& service,
- const GoogleServiceAuthError& error) {
- NOTREACHED();
- }
-
- private:
- Profile* profile_;
- std::string username_;
- std::string password_; // This is kept empty whenever possible.
- scoped_ptr<GaiaAuthenticator2> client_login_;
-};
-
-#endif // CHROME_BROWSER_SYNC_SIGNIN_MANAGER_H_