Rename GoogleServiceAuthError::None() to AuthErrorNone() and LoginFailure::None() to LoginFailureNone() so that they do not clash with None defined in /usr/include/X11/X.h.
TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/12686006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187652 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
chrome/browser
chromeos
login
policy
printing
cloud_print
signin
fake_auth_status_provider.ccoauth2_token_service.ccoauth2_token_service_request_unittest.ccoauth2_token_service_unittest.ccsignin_global_error.ccsignin_global_error_unittest.ccubertoken_fetcher_unittest.cc
sync
ui
google_apis/gaia
@ -52,7 +52,7 @@ LoginPerformer* LoginPerformer::default_performer_ = NULL;
|
||||
|
||||
LoginPerformer::LoginPerformer(Delegate* delegate)
|
||||
: ALLOW_THIS_IN_INITIALIZER_LIST(online_attempt_host_(this)),
|
||||
last_login_failure_(LoginFailure::None()),
|
||||
last_login_failure_(LoginFailure::LoginFailureNone()),
|
||||
delegate_(delegate),
|
||||
password_changed_(false),
|
||||
password_changed_callback_count_(0),
|
||||
|
@ -195,7 +195,7 @@ class LoginPerformer : public LoginStatusConsumer,
|
||||
OnlineAttemptHost online_attempt_host_;
|
||||
|
||||
// Represents last login failure that was encountered when communicating to
|
||||
// sign-in server. LoginFailure.None() by default.
|
||||
// sign-in server. LoginFailure.LoginFailureNone() by default.
|
||||
LoginFailure last_login_failure_;
|
||||
|
||||
// Username and password for the current login attempt.
|
||||
|
@ -56,7 +56,7 @@ class LoginFailure {
|
||||
return LoginFailure(NETWORK_AUTH_FAILED, error);
|
||||
}
|
||||
|
||||
static LoginFailure None() {
|
||||
static LoginFailure LoginFailureNone() {
|
||||
return LoginFailure(NONE);
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ void OnlineAttempt::OnClientLoginSuccess(
|
||||
TryClientLogin();
|
||||
return;
|
||||
}
|
||||
TriggerResolve(LoginFailure::None());
|
||||
TriggerResolve(LoginFailure::LoginFailureNone());
|
||||
}
|
||||
|
||||
void OnlineAttempt::OnClientLoginFailure(
|
||||
@ -121,7 +121,7 @@ void OnlineAttempt::OnClientLoginFailure(
|
||||
|
||||
if (error.state() == GoogleServiceAuthError::TWO_FACTOR) {
|
||||
LOG(WARNING) << "Two factor authenticated. Sync will not work.";
|
||||
TriggerResolve(LoginFailure::None());
|
||||
TriggerResolve(LoginFailure::LoginFailureNone());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ TEST_F(OnlineAttemptTest, FullLogin) {
|
||||
|
||||
MessageLoop::current()->Run();
|
||||
|
||||
EXPECT_EQ(LoginFailure::None(), local_state.online_outcome());
|
||||
EXPECT_EQ(LoginFailure::LoginFailureNone(), local_state.online_outcome());
|
||||
}
|
||||
|
||||
TEST_F(OnlineAttemptTest, LoginNetFailure) {
|
||||
@ -253,7 +253,7 @@ TEST_F(OnlineAttemptTest, TwoFactorSuccess) {
|
||||
|
||||
// Force UI thread to finish tasks so I can verify |state_|.
|
||||
message_loop_.RunUntilIdle();
|
||||
EXPECT_TRUE(GoogleServiceAuthError::None() ==
|
||||
EXPECT_TRUE(GoogleServiceAuthError::AuthErrorNone() ==
|
||||
state_.online_outcome().error());
|
||||
}
|
||||
|
||||
|
@ -840,7 +840,7 @@ ParallelAuthenticator::ResolveOnlineSuccessState(
|
||||
|
||||
void ParallelAuthenticator::ResolveLoginCompletionStatus() {
|
||||
// Shortcut online state resolution process.
|
||||
current_state_->RecordOnlineLoginStatus(LoginFailure::None());
|
||||
current_state_->RecordOnlineLoginStatus(LoginFailure::LoginFailureNone());
|
||||
Resolve();
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ TEST_F(ParallelAuthenticatorTest, ResolveNeedOldPw) {
|
||||
// and been rejected because of unmatched key; additionally,
|
||||
// an online auth attempt has completed successfully.
|
||||
state_->PresetCryptohomeStatus(false, cryptohome::MOUNT_ERROR_KEY_FAILURE);
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::None());
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::LoginFailureNone());
|
||||
|
||||
EXPECT_EQ(ParallelAuthenticator::NEED_OLD_PW,
|
||||
SetAndResolveState(auth_, state_.release()));
|
||||
@ -454,7 +454,7 @@ TEST_F(ParallelAuthenticatorTest, DriveDataResync) {
|
||||
.Times(1)
|
||||
.RetiresOnSaturation();
|
||||
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::None());
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::LoginFailureNone());
|
||||
SetAttemptState(auth_, state_.release());
|
||||
|
||||
auth_->ResyncEncryptedData();
|
||||
@ -482,7 +482,7 @@ TEST_F(ParallelAuthenticatorTest, DriveRequestOldPassword) {
|
||||
ExpectPasswordChange();
|
||||
|
||||
state_->PresetCryptohomeStatus(false, cryptohome::MOUNT_ERROR_KEY_FAILURE);
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::None());
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::LoginFailureNone());
|
||||
SetAttemptState(auth_, state_.release());
|
||||
|
||||
RunResolve(auth_.get());
|
||||
@ -505,7 +505,7 @@ TEST_F(ParallelAuthenticatorTest, DriveDataRecover) {
|
||||
.WillOnce(Return(std::string()))
|
||||
.RetiresOnSaturation();
|
||||
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::None());
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::LoginFailureNone());
|
||||
SetAttemptState(auth_, state_.release());
|
||||
|
||||
auth_->RecoverEncryptedData(std::string());
|
||||
@ -563,7 +563,7 @@ TEST_F(ParallelAuthenticatorTest, ResolveCreateNew) {
|
||||
// an online auth attempt has completed successfully.
|
||||
state_->PresetCryptohomeStatus(false,
|
||||
cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST);
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::None());
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::LoginFailureNone());
|
||||
|
||||
EXPECT_EQ(ParallelAuthenticator::CREATE_NEW,
|
||||
SetAndResolveState(auth_, state_.release()));
|
||||
@ -586,7 +586,7 @@ TEST_F(ParallelAuthenticatorTest, DriveCreateForNewUser) {
|
||||
// an online auth attempt has completed successfully.
|
||||
state_->PresetCryptohomeStatus(false,
|
||||
cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST);
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::None());
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::LoginFailureNone());
|
||||
SetAttemptState(auth_, state_.release());
|
||||
|
||||
RunResolve(auth_.get());
|
||||
@ -725,7 +725,7 @@ TEST_F(ParallelAuthenticatorTest, DriveOnlineLogin) {
|
||||
// Set up state as though a cryptohome mount attempt has occurred and
|
||||
// succeeded.
|
||||
state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE);
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::None());
|
||||
state_->PresetOnlineLoginStatus(LoginFailure::LoginFailureNone());
|
||||
SetAttemptState(auth_, state_.release());
|
||||
|
||||
RunResolve(auth_.get());
|
||||
|
@ -53,7 +53,7 @@ void UserInfoFetcher::Start(const std::string& access_token) {
|
||||
|
||||
void UserInfoFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
|
||||
net::URLRequestStatus status = source->GetStatus();
|
||||
GoogleServiceAuthError error = GoogleServiceAuthError::None();
|
||||
GoogleServiceAuthError error = GoogleServiceAuthError::AuthErrorNone();
|
||||
if (!status.is_success()) {
|
||||
if (status.status() == net::URLRequestStatus::CANCELED)
|
||||
error = GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED);
|
||||
|
@ -98,7 +98,7 @@ CloudPrintSetupFlow::CloudPrintSetupFlow(
|
||||
bool setup_done)
|
||||
: web_ui_(NULL),
|
||||
dialog_start_args_(args),
|
||||
last_auth_error_(GoogleServiceAuthError::None()),
|
||||
last_auth_error_(GoogleServiceAuthError::AuthErrorNone()),
|
||||
setup_done_(setup_done),
|
||||
process_control_(NULL),
|
||||
delegate_(delegate) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
FakeAuthStatusProvider::FakeAuthStatusProvider(SigninGlobalError* error)
|
||||
: global_error_(error),
|
||||
auth_error_(GoogleServiceAuthError::None()) {
|
||||
auth_error_(GoogleServiceAuthError::AuthErrorNone()) {
|
||||
global_error_->AddProvider(this);
|
||||
}
|
||||
|
||||
|
@ -520,7 +520,7 @@ void OAuth2TokenService::Observe(int type,
|
||||
// OAuth2 access tokens. If this token either changes or is cleared, any
|
||||
// available tokens must be invalidated.
|
||||
token_cache_.clear();
|
||||
UpdateAuthError(GoogleServiceAuthError::None());
|
||||
UpdateAuthError(GoogleServiceAuthError::AuthErrorNone());
|
||||
}
|
||||
|
||||
void OAuth2TokenService::UpdateAuthError(const GoogleServiceAuthError& error) {
|
||||
|
@ -36,7 +36,7 @@ class TestingOAuth2TokenServiceConsumer : public OAuth2TokenService::Consumer {
|
||||
|
||||
TestingOAuth2TokenServiceConsumer::TestingOAuth2TokenServiceConsumer()
|
||||
: number_of_correct_tokens_(0),
|
||||
last_error_(GoogleServiceAuthError::None()),
|
||||
last_error_(GoogleServiceAuthError::AuthErrorNone()),
|
||||
number_of_errors_(0) {
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ class TestingOAuth2TokenServiceConsumer : public OAuth2TokenService::Consumer {
|
||||
public:
|
||||
TestingOAuth2TokenServiceConsumer()
|
||||
: number_of_correct_tokens_(0),
|
||||
last_error_(GoogleServiceAuthError::None()),
|
||||
last_error_(GoogleServiceAuthError::AuthErrorNone()),
|
||||
number_of_errors_(0) {}
|
||||
virtual ~TestingOAuth2TokenServiceConsumer() {}
|
||||
|
||||
@ -66,7 +66,7 @@ class RetryingTestingOAuth2TokenServiceConsumer
|
||||
OAuth2TokenService* oauth2_service)
|
||||
: oauth2_service_(oauth2_service),
|
||||
number_of_correct_tokens_(0),
|
||||
last_error_(GoogleServiceAuthError::None()),
|
||||
last_error_(GoogleServiceAuthError::AuthErrorNone()),
|
||||
number_of_errors_(0) {}
|
||||
virtual ~RetryingTestingOAuth2TokenServiceConsumer() {}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
SigninGlobalError::SigninGlobalError(SigninManager* manager, Profile* profile)
|
||||
: auth_error_(GoogleServiceAuthError::None()),
|
||||
: auth_error_(GoogleServiceAuthError::AuthErrorNone()),
|
||||
signin_manager_(manager),
|
||||
profile_(profile) {
|
||||
}
|
||||
@ -54,7 +54,7 @@ SigninGlobalError::AuthStatusProvider::~AuthStatusProvider() {
|
||||
|
||||
void SigninGlobalError::AuthStatusChanged() {
|
||||
// Walk all of the status providers and collect any error.
|
||||
GoogleServiceAuthError current_error(GoogleServiceAuthError::None());
|
||||
GoogleServiceAuthError current_error(GoogleServiceAuthError::AuthErrorNone());
|
||||
for (std::set<const AuthStatusProvider*>::const_iterator it =
|
||||
provider_set_.begin(); it != provider_set_.end(); ++it) {
|
||||
current_error = (*it)->GetAuthStatus();
|
||||
|
@ -77,9 +77,9 @@ TEST_F(SigninGlobalErrorTest, AuthStatusProviderErrorTransition) {
|
||||
ASSERT_TRUE(global_error_->HasBadge());
|
||||
|
||||
// Now resolve the auth errors - badge should go away.
|
||||
provider0.SetAuthError(GoogleServiceAuthError::None());
|
||||
provider0.SetAuthError(GoogleServiceAuthError::AuthErrorNone());
|
||||
ASSERT_TRUE(global_error_->HasBadge());
|
||||
provider1.SetAuthError(GoogleServiceAuthError::None());
|
||||
provider1.SetAuthError(GoogleServiceAuthError::AuthErrorNone());
|
||||
ASSERT_FALSE(global_error_->HasBadge());
|
||||
}
|
||||
ASSERT_FALSE(global_error_->HasBadge());
|
||||
|
@ -17,7 +17,7 @@ class MockUbertokenConsumer : public UbertokenConsumer {
|
||||
public:
|
||||
MockUbertokenConsumer()
|
||||
: nb_correct_token_(0),
|
||||
last_error_(GoogleServiceAuthError::None()),
|
||||
last_error_(GoogleServiceAuthError::AuthErrorNone()),
|
||||
nb_error_(0) {
|
||||
}
|
||||
virtual ~MockUbertokenConsumer() {}
|
||||
|
@ -132,7 +132,7 @@ ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory,
|
||||
Profile* profile,
|
||||
SigninManager* signin_manager,
|
||||
StartBehavior start_behavior)
|
||||
: last_auth_error_(AuthError::None()),
|
||||
: last_auth_error_(AuthError::AuthErrorNone()),
|
||||
passphrase_required_reason_(syncer::REASON_PASSPHRASE_NOT_REQUIRED),
|
||||
factory_(factory),
|
||||
profile_(profile),
|
||||
@ -669,7 +669,7 @@ void ProfileSyncService::ShutdownImpl(bool sync_disabled) {
|
||||
passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED;
|
||||
// Revert to "no auth error".
|
||||
if (last_auth_error_.state() != GoogleServiceAuthError::NONE)
|
||||
UpdateAuthErrorState(GoogleServiceAuthError::None());
|
||||
UpdateAuthErrorState(GoogleServiceAuthError::AuthErrorNone());
|
||||
|
||||
if (sync_global_error_.get()) {
|
||||
GlobalErrorServiceFactory::GetForProfile(profile_)->RemoveGlobalError(
|
||||
@ -1003,7 +1003,7 @@ AuthError ConnectionStatusToAuthError(
|
||||
syncer::ConnectionStatus status) {
|
||||
switch (status) {
|
||||
case syncer::CONNECTION_OK:
|
||||
return AuthError::None();
|
||||
return AuthError::AuthErrorNone();
|
||||
break;
|
||||
case syncer::CONNECTION_AUTH_ERROR:
|
||||
return AuthError(AuthError::INVALID_GAIA_CREDENTIALS);
|
||||
|
@ -838,7 +838,7 @@ void SyncSetupHandler::TryLogin(const std::string& username,
|
||||
|
||||
// User is trying to log in again so reset the cached error.
|
||||
GoogleServiceAuthError current_error = last_signin_error_;
|
||||
last_signin_error_ = GoogleServiceAuthError::None();
|
||||
last_signin_error_ = GoogleServiceAuthError::AuthErrorNone();
|
||||
|
||||
SigninManager* signin = GetSignin();
|
||||
|
||||
@ -1131,7 +1131,7 @@ void SyncSetupHandler::CloseSyncSetup() {
|
||||
// overlay in the settings page will stay in whatever error state it was last
|
||||
// when it is reopened.
|
||||
last_attempted_user_email_.clear();
|
||||
last_signin_error_ = GoogleServiceAuthError::None();
|
||||
last_signin_error_ = GoogleServiceAuthError::AuthErrorNone();
|
||||
|
||||
configuring_sync_ = false;
|
||||
signin_tracker_.reset();
|
||||
|
@ -360,7 +360,7 @@ class SyncSetupHandlerTest : public testing::TestWithParam<bool> {
|
||||
switches::kUseClientLoginSigninFlow));
|
||||
}
|
||||
|
||||
error_ = GoogleServiceAuthError::None();
|
||||
error_ = GoogleServiceAuthError::AuthErrorNone();
|
||||
profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile());
|
||||
mock_pss_ = static_cast<ProfileSyncServiceMock*>(
|
||||
ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse(
|
||||
@ -515,7 +515,7 @@ TEST_P(SyncSetupHandlerTest, DisplayConfigureWithBackendDisabledAndCancel) {
|
||||
.WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
|
||||
.WillRepeatedly(Return(false));
|
||||
error_ = GoogleServiceAuthError::None();
|
||||
error_ = GoogleServiceAuthError::AuthErrorNone();
|
||||
EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_));
|
||||
EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(false));
|
||||
|
||||
@ -557,7 +557,7 @@ TEST_P(SyncSetupHandlerTest,
|
||||
.WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
|
||||
.WillRepeatedly(Return(false));
|
||||
error_ = GoogleServiceAuthError::None();
|
||||
error_ = GoogleServiceAuthError::AuthErrorNone();
|
||||
EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_));
|
||||
// Sync backend is stopped initially, and will start up.
|
||||
EXPECT_CALL(*mock_pss_, sync_initialized())
|
||||
@ -614,7 +614,7 @@ TEST_P(SyncSetupHandlerTest,
|
||||
.WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
|
||||
.WillRepeatedly(Return(false));
|
||||
error_ = GoogleServiceAuthError::None();
|
||||
error_ = GoogleServiceAuthError::AuthErrorNone();
|
||||
EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_));
|
||||
EXPECT_CALL(*mock_pss_, sync_initialized())
|
||||
.WillOnce(Return(false))
|
||||
@ -644,7 +644,7 @@ TEST_P(SyncSetupHandlerTest,
|
||||
.WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
|
||||
.WillRepeatedly(Return(false));
|
||||
error_ = GoogleServiceAuthError::None();
|
||||
error_ = GoogleServiceAuthError::AuthErrorNone();
|
||||
EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_));
|
||||
EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(false));
|
||||
|
||||
|
@ -139,7 +139,7 @@ GoogleServiceAuthError GoogleServiceAuthError::FromClientOAuthError(
|
||||
return GoogleServiceAuthError(explanation);
|
||||
}
|
||||
|
||||
GoogleServiceAuthError GoogleServiceAuthError::None() {
|
||||
GoogleServiceAuthError GoogleServiceAuthError::AuthErrorNone() {
|
||||
return GoogleServiceAuthError(NONE);
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ class GoogleServiceAuthError {
|
||||
// Provided for convenience for clients needing to reset an instance to NONE.
|
||||
// (avoids err_ = GoogleServiceAuthError(GoogleServiceAuthError::NONE), due
|
||||
// to explicit class and State enum relation. Note: shouldn't be inlined!
|
||||
static GoogleServiceAuthError None();
|
||||
static GoogleServiceAuthError AuthErrorNone();
|
||||
|
||||
// The error information.
|
||||
State state() const;
|
||||
|
@ -37,7 +37,7 @@ TEST_F(GoogleServiceAuthErrorTest, SimpleToValue) {
|
||||
}
|
||||
|
||||
TEST_F(GoogleServiceAuthErrorTest, None) {
|
||||
GoogleServiceAuthError error(GoogleServiceAuthError::None());
|
||||
GoogleServiceAuthError error(GoogleServiceAuthError::AuthErrorNone());
|
||||
scoped_ptr<DictionaryValue> value(error.ToValue());
|
||||
EXPECT_EQ(1u, value->size());
|
||||
ExpectDictStringValue("NONE", *value, "state");
|
||||
|
Reference in New Issue
Block a user