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

Unified Diff: chromeos/login/auth/online_attempt_host.cc

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
« no previous file with comments | « chromeos/login/auth/online_attempt_host.h ('k') | chromeos/tpm_password_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/login/auth/online_attempt_host.cc
diff --git a/chrome/browser/chromeos/login/auth/online_attempt_host.cc b/chromeos/login/auth/online_attempt_host.cc
similarity index 61%
rename from chrome/browser/chromeos/login/auth/online_attempt_host.cc
rename to chromeos/login/auth/online_attempt_host.cc
index 277e2d88e319774d03f30a644c4c6d11d4c51454..6b742f8d15b31783c14267b3bea24f63b242a127 100644
--- a/chrome/browser/chromeos/login/auth/online_attempt_host.cc
+++ b/chromeos/login/auth/online_attempt_host.cc
@@ -2,28 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/login/auth/online_attempt_host.h"
+#include "chromeos/login/auth/online_attempt_host.h"
#include "base/bind.h"
-#include "chrome/browser/chromeos/login/auth/online_attempt.h"
+#include "base/location.h"
+#include "base/message_loop/message_loop_proxy.h"
#include "chromeos/login/auth/auth_attempt_state.h"
+#include "chromeos/login/auth/online_attempt.h"
#include "chromeos/login/auth/user_context.h"
#include "components/user_manager/user_type.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/browser_thread.h"
namespace chromeos {
OnlineAttemptHost::OnlineAttemptHost(Delegate* delegate)
- : delegate_(delegate), weak_ptr_factory_(this) {}
+ : message_loop_(base::MessageLoopProxy::current()),
+ delegate_(delegate),
+ weak_ptr_factory_(this) {
+}
OnlineAttemptHost::~OnlineAttemptHost() {
Reset();
}
-void OnlineAttemptHost::Check(content::BrowserContext* auth_context,
+void OnlineAttemptHost::Check(net::URLRequestContextGetter* request_context,
const UserContext& user_context) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (user_context != current_attempt_user_context_) {
Reset();
current_attempt_user_context_ = user_context;
@@ -34,31 +36,26 @@ void OnlineAttemptHost::Check(content::BrowserContext* auth_context,
false, // online_complete
false)); // user_is_new
online_attempt_.reset(new OnlineAttempt(state_.get(), this));
- online_attempt_->Initiate(auth_context);
+ online_attempt_->Initiate(request_context);
}
}
void OnlineAttemptHost::Reset() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
online_attempt_.reset(NULL);
current_attempt_user_context_ = UserContext();
}
void OnlineAttemptHost::Resolve() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (state_->online_complete()) {
bool success = state_->online_outcome().reason() == AuthFailure::NONE;
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(&OnlineAttemptHost::ResolveOnUIThread,
- weak_ptr_factory_.GetWeakPtr(),
- success));
+ message_loop_->PostTask(FROM_HERE,
+ base::Bind(&OnlineAttemptHost::ResolveOnUIThread,
+ weak_ptr_factory_.GetWeakPtr(),
+ success));
}
}
void OnlineAttemptHost::ResolveOnUIThread(bool success) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
delegate_->OnChecked(current_attempt_user_context_.GetUserID(), success);
Reset();
}
« no previous file with comments | « chromeos/login/auth/online_attempt_host.h ('k') | chromeos/tpm_password_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698