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

Side by Side Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 10818006: Re-enable OTP sign in on trunk (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: rebase Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/sync_setup_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (user.find_first_of(ASCIIToUTF16("@")) != string16::npos) 179 if (user.find_first_of(ASCIIToUTF16("@")) != string16::npos)
180 return user; 180 return user;
181 return user + ASCIIToUTF16("@") + ASCIIToUTF16(kDefaultSigninDomain); 181 return user + ASCIIToUTF16("@") + ASCIIToUTF16(kDefaultSigninDomain);
182 } 182 }
183 183
184 bool AreUserNamesEqual(const string16& user1, const string16& user2) { 184 bool AreUserNamesEqual(const string16& user1, const string16& user2) {
185 return NormalizeUserName(user1) == NormalizeUserName(user2); 185 return NormalizeUserName(user1) == NormalizeUserName(user2);
186 } 186 }
187 187
188 bool IsClientOAuthEnabled() { 188 bool IsClientOAuthEnabled() {
189 return CommandLine::ForCurrentProcess()->HasSwitch( 189 return !CommandLine::ForCurrentProcess()->HasSwitch(
190 switches::kEnableClientOAuthSignin); 190 switches::kDisableClientOAuthSignin);
191 } 191 }
192 192
193 } // namespace 193 } // namespace
194 194
195 SyncSetupHandler::SyncSetupHandler(ProfileManager* profile_manager) 195 SyncSetupHandler::SyncSetupHandler(ProfileManager* profile_manager)
196 : configuring_sync_(false), 196 : configuring_sync_(false),
197 profile_manager_(profile_manager), 197 profile_manager_(profile_manager),
198 last_signin_error_(GoogleServiceAuthError::NONE), 198 last_signin_error_(GoogleServiceAuthError::NONE),
199 retry_on_signin_failure_(true) { 199 retry_on_signin_failure_(true) {
200 } 200 }
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 if (i != current_profile_index && AreUserNamesEqual( 1044 if (i != current_profile_index && AreUserNamesEqual(
1045 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { 1045 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) {
1046 *error_message = l10n_util::GetStringUTF16( 1046 *error_message = l10n_util::GetStringUTF16(
1047 IDS_SYNC_USER_NAME_IN_USE_ERROR); 1047 IDS_SYNC_USER_NAME_IN_USE_ERROR);
1048 return false; 1048 return false;
1049 } 1049 }
1050 } 1050 }
1051 1051
1052 return true; 1052 return true;
1053 } 1053 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.cc ('k') | chrome/browser/ui/webui/sync_setup_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698