summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-12 03:50:59 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-12 03:50:59 +0000
commitf5ffecf35b670b1d10b3a27f6a408af5c187413c (patch)
tree244087f7eeb2a2d5f354a613253a6e1b3f49024a
parenta627bac237af4f0d14e042192e4563450a7d8014 (diff)
downloadchromium_src-f5ffecf35b670b1d10b3a27f6a408af5c187413c.zip
chromium_src-f5ffecf35b670b1d10b3a27f6a408af5c187413c.tar.gz
chromium_src-f5ffecf35b670b1d10b3a27f6a408af5c187413c.tar.bz2
base::Bind: Final cleanup in chromeos/login.
BUG=none TEST=none R=csilv@chromium.org Review URL: http://codereview.chromium.org/8232015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104999 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/login/google_authenticator.cc47
-rw-r--r--chrome/browser/chromeos/login/online_attempt_unittest.cc4
-rw-r--r--chrome/browser/chromeos/user_cros_settings_provider.cc5
3 files changed, 19 insertions, 37 deletions
diff --git a/chrome/browser/chromeos/login/google_authenticator.cc b/chrome/browser/chromeos/login/google_authenticator.cc
index 48488ff..557a374a 100644
--- a/chrome/browser/chromeos/login/google_authenticator.cc
+++ b/chrome/browser/chromeos/login/google_authenticator.cc
@@ -93,10 +93,8 @@ void GoogleAuthenticator::TryClientLogin() {
hosted_policy_);
BrowserThread::PostDelayedTask(
- BrowserThread::UI,
- FROM_HERE,
- NewRunnableMethod(this,
- &GoogleAuthenticator::CancelClientLogin),
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&GoogleAuthenticator::CancelClientLogin, this),
kClientLoginTimeoutMs);
}
@@ -127,9 +125,8 @@ void GoogleAuthenticator::CompleteLogin(Profile* profile,
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &GoogleAuthenticator::OnLoginSuccess,
- GaiaAuthConsumer::ClientLoginResult(), false));
+ base::Bind(&GoogleAuthenticator::OnLoginSuccess, this,
+ GaiaAuthConsumer::ClientLoginResult(), false));
}
void GoogleAuthenticator::AuthenticateToLogin(
@@ -163,13 +160,12 @@ void GoogleAuthenticator::AuthenticateToUnlock(const std::string& username,
unlock_ = true;
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(this,
- &GoogleAuthenticator::LoadLocalaccount,
- std::string(kLocalaccountFile)));
+ base::Bind(&GoogleAuthenticator::LoadLocalaccount, this,
+ std::string(kLocalaccountFile)));
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this, &GoogleAuthenticator::CheckOffline,
- LoginFailure(LoginFailure::UNLOCK_FAILED)));
+ base::Bind(&GoogleAuthenticator::CheckOffline, this,
+ LoginFailure(LoginFailure::UNLOCK_FAILED)));
}
void GoogleAuthenticator::LoginOffTheRecord() {
@@ -210,9 +206,8 @@ void GoogleAuthenticator::OnClientLoginSuccess(
}
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &GoogleAuthenticator::OnLoginSuccess,
- credentials, false));
+ base::Bind(&GoogleAuthenticator::OnLoginSuccess, this, credentials,
+ false));
}
void GoogleAuthenticator::OnClientLoginFailure(
@@ -239,9 +234,8 @@ void GoogleAuthenticator::OnClientLoginFailure(
GoogleServiceAuthError::HOSTED_NOT_ALLOWED));
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &GoogleAuthenticator::OnLoginFailure,
- failure_details));
+ base::Bind(&GoogleAuthenticator::OnLoginFailure, this,
+ failure_details));
LOG(WARNING) << "Rejecting valid HOSTED account.";
hosted_policy_ = GaiaAuthFetcher::HostedAccountsNotAllowed;
return;
@@ -259,9 +253,8 @@ void GoogleAuthenticator::OnClientLoginFailure(
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(this,
- &GoogleAuthenticator::LoadLocalaccount,
- std::string(kLocalaccountFile)));
+ base::Bind(&GoogleAuthenticator::LoadLocalaccount, this,
+ std::string(kLocalaccountFile)));
LoginFailure failure_details = LoginFailure::FromNetworkAuthFailure(error);
@@ -269,17 +262,15 @@ void GoogleAuthenticator::OnClientLoginFailure(
// The fetch failed for network reasons, try offline login.
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this, &GoogleAuthenticator::CheckOffline,
- failure_details));
+ base::Bind(&GoogleAuthenticator::CheckOffline, this, failure_details));
return;
}
// The fetch succeeded, but ClientLogin said no, or we exhausted retries.
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &GoogleAuthenticator::CheckLocalaccount,
- failure_details));
+ base::Bind(&GoogleAuthenticator::CheckLocalaccount, this,
+ failure_details));
}
void GoogleAuthenticator::OnLoginSuccess(
@@ -334,9 +325,7 @@ void GoogleAuthenticator::CheckLocalaccount(const LoginFailure& error) {
BrowserThread::PostDelayedTask(
BrowserThread::UI,
FROM_HERE,
- NewRunnableMethod(this,
- &GoogleAuthenticator::CheckLocalaccount,
- error),
+ base::Bind(&GoogleAuthenticator::CheckLocalaccount, this, error),
kLocalaccountRetryIntervalMs);
return;
}
diff --git a/chrome/browser/chromeos/login/online_attempt_unittest.cc b/chrome/browser/chromeos/login/online_attempt_unittest.cc
index 3b67c14..e4343fd 100644
--- a/chrome/browser/chromeos/login/online_attempt_unittest.cc
+++ b/chrome/browser/chromeos/login/online_attempt_unittest.cc
@@ -261,9 +261,7 @@ TEST_F(OnlineAttemptTest, TwoFactorSuccess) {
GoogleServiceAuthError error(GoogleServiceAuthError::TWO_FACTOR);
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(attempt_.get(),
- &OnlineAttempt::OnClientLoginFailure,
- error));
+ base::Bind(&OnlineAttempt::OnClientLoginFailure, attempt_.get(), error));
// Force IO thread to finish tasks so I can verify |state_|.
io_thread_.Stop();
diff --git a/chrome/browser/chromeos/user_cros_settings_provider.cc b/chrome/browser/chromeos/user_cros_settings_provider.cc
index d6e4df2..1d71c927 100644
--- a/chrome/browser/chromeos/user_cros_settings_provider.cc
+++ b/chrome/browser/chromeos/user_cros_settings_provider.cc
@@ -14,7 +14,6 @@
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "base/string_util.h"
-#include "base/task.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
@@ -555,10 +554,6 @@ class UserCrosSettingsTrust : public SignedSettingsHelper::Callback {
} // namespace chromeos
-// We want to use NewRunnableMethod with this class but need to disable
-// reference counting since it is singleton.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::UserCrosSettingsTrust);
-
namespace chromeos {
UserCrosSettingsProvider::UserCrosSettingsProvider() {