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

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

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 } 1295 }
1296 1296
1297 void SyncSetupHandler::CloseGaiaSigninPage() { 1297 void SyncSetupHandler::CloseGaiaSigninPage() {
1298 if (active_gaia_signin_tab_) { 1298 if (active_gaia_signin_tab_) {
1299 content::WebContentsObserver::Observe(NULL); 1299 content::WebContentsObserver::Observe(NULL);
1300 1300
1301 // This can be invoked from a webui handler in the GAIA page (for example, 1301 // This can be invoked from a webui handler in the GAIA page (for example,
1302 // if the user clicks 'cancel' in the enterprise signin dialog), so 1302 // if the user clicks 'cancel' in the enterprise signin dialog), so
1303 // closing this tab in mid-handler can cause crashes. Instead, close it 1303 // closing this tab in mid-handler can cause crashes. Instead, close it
1304 // via a task so we know we aren't in the middle of any webui code. 1304 // via a task so we know we aren't in the middle of any webui code.
1305 MessageLoop::current()->PostTask( 1305 base::MessageLoop::current()->PostTask(
1306 FROM_HERE, 1306 FROM_HERE,
1307 base::Bind(&CloseTab, base::Unretained(active_gaia_signin_tab_))); 1307 base::Bind(&CloseTab, base::Unretained(active_gaia_signin_tab_)));
1308 1308
1309 active_gaia_signin_tab_ = NULL; 1309 active_gaia_signin_tab_ = NULL;
1310 } 1310 }
1311 } 1311 }
1312 1312
1313 bool SyncSetupHandler::IsLoginAuthDataValid(const std::string& username, 1313 bool SyncSetupHandler::IsLoginAuthDataValid(const std::string& username,
1314 string16* error_message) { 1314 string16* error_message) {
1315 if (username.empty()) 1315 if (username.empty())
(...skipping 23 matching lines...) Expand all
1339 if (i != current_profile_index && AreUserNamesEqual( 1339 if (i != current_profile_index && AreUserNamesEqual(
1340 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { 1340 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) {
1341 *error_message = l10n_util::GetStringUTF16( 1341 *error_message = l10n_util::GetStringUTF16(
1342 IDS_SYNC_USER_NAME_IN_USE_ERROR); 1342 IDS_SYNC_USER_NAME_IN_USE_ERROR);
1343 return false; 1343 return false;
1344 } 1344 }
1345 } 1345 }
1346 1346
1347 return true; 1347 return true;
1348 } 1348 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_internals_ui_unittest.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