Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: chrome/browser/chromeos/login/auth/online_attempt.h

Issue 402403004: Refactoring : Move OnlineAttempt to chromeos/login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yet another merge with ToT Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/auth/online_attempt.h
diff --git a/chrome/browser/chromeos/login/auth/online_attempt.h b/chrome/browser/chromeos/login/auth/online_attempt.h
deleted file mode 100644
index b12b33296d825314dfc78d473df35ccffad532f1..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/auth/online_attempt.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_
-#define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_
-
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "base/gtest_prod_util.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "chromeos/login/auth/auth_status_consumer.h"
-#include "google_apis/gaia/gaia_auth_consumer.h"
-#include "google_apis/gaia/google_service_auth_error.h"
-
-class GaiaAuthFetcher;
-
-namespace content {
-class BrowserContext;
-}
-
-namespace chromeos {
-class AuthAttemptState;
-class AuthAttemptStateResolver;
-
-class OnlineAttempt
- : public GaiaAuthConsumer {
- public:
- OnlineAttempt(AuthAttemptState* current_attempt,
- AuthAttemptStateResolver* callback);
- virtual ~OnlineAttempt();
-
- // Initiate the online login attempt either through client or auth login.
- // Status will be recorded in |current_attempt|, and resolver_->Resolve() will
- // be called on the IO thread when useful state is available.
- // Must be called on the UI thread.
- void Initiate(content::BrowserContext* auth_context);
-
- // GaiaAuthConsumer overrides. Callbacks from GaiaAuthFetcher
- virtual void OnClientLoginFailure(
- const GoogleServiceAuthError& error) OVERRIDE;
- virtual void OnClientLoginSuccess(
- const GaiaAuthConsumer::ClientLoginResult& credentials) OVERRIDE;
-
- private:
- FRIEND_TEST_ALL_PREFIXES(OnlineAttemptTest, LoginSuccess);
- FRIEND_TEST_ALL_PREFIXES(OnlineAttemptTest, TwoFactorSuccess);
-
- // Milliseconds until we timeout our attempt to hit ClientLogin.
- static const int kClientLoginTimeoutMs;
-
- void TryClientLogin();
- void CancelClientLogin();
-
- void TriggerResolve(const AuthFailure& outcome);
-
- bool HasPendingFetch();
- void CancelRequest();
-
- AuthAttemptState* const attempt_;
- AuthAttemptStateResolver* const resolver_;
-
- // Handles ClientLogin communications with Gaia.
- scoped_ptr<GaiaAuthFetcher> client_fetcher_;
-
- // Used to cancel the CancelClientLogin closure.
- base::WeakPtrFactory<OnlineAttempt> weak_factory_;
-
- // Whether we're willing to re-try the ClientLogin attempt.
- bool try_again_;
-
- friend class OnlineAttemptTest;
- DISALLOW_COPY_AND_ASSIGN(OnlineAttempt);
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_ONLINE_ATTEMPT_H_
« no previous file with comments | « chrome/browser/chromeos/login/auth/mock_url_fetchers.cc ('k') | chrome/browser/chromeos/login/auth/online_attempt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698