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

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

Issue 11434074: browser: Move FindBrowserWithWebContents() into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 561 }
562 562
563 SigninManager* SyncSetupHandler::GetSignin() const { 563 SigninManager* SyncSetupHandler::GetSignin() const {
564 return SigninManagerFactory::GetForProfile(GetProfile()); 564 return SigninManagerFactory::GetForProfile(GetProfile());
565 } 565 }
566 566
567 void SyncSetupHandler::DisplayGaiaLogin(bool fatal_error) { 567 void SyncSetupHandler::DisplayGaiaLogin(bool fatal_error) {
568 if (UseWebBasedSigninFlow()) { 568 if (UseWebBasedSigninFlow()) {
569 GURL url(SyncPromoUI::GetSyncPromoURL(GURL(), 569 GURL url(SyncPromoUI::GetSyncPromoURL(GURL(),
570 SyncPromoUI::SOURCE_SETTINGS, false)); 570 SyncPromoUI::SOURCE_SETTINGS, false));
571 Browser* browser = browser::FindBrowserWithWebContents( 571 Browser* browser = chrome::FindBrowserWithWebContents(
572 web_ui()->GetWebContents()); 572 web_ui()->GetWebContents());
573 browser->OpenURL( 573 browser->OpenURL(
574 content::OpenURLParams(url, content::Referrer(), SINGLETON_TAB, 574 content::OpenURLParams(url, content::Referrer(), SINGLETON_TAB,
575 content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); 575 content::PAGE_TRANSITION_AUTO_BOOKMARK, false));
576 } else { 576 } else {
577 retry_on_signin_failure_ = true; 577 retry_on_signin_failure_ = true;
578 DisplayGaiaLoginWithErrorMessage(string16(), fatal_error); 578 DisplayGaiaLoginWithErrorMessage(string16(), fatal_error);
579 } 579 }
580 } 580 }
581 581
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 if (i != current_profile_index && AreUserNamesEqual( 1149 if (i != current_profile_index && AreUserNamesEqual(
1150 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { 1150 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) {
1151 *error_message = l10n_util::GetStringUTF16( 1151 *error_message = l10n_util::GetStringUTF16(
1152 IDS_SYNC_USER_NAME_IN_USE_ERROR); 1152 IDS_SYNC_USER_NAME_IN_USE_ERROR);
1153 return false; 1153 return false;
1154 } 1154 }
1155 } 1155 }
1156 1156
1157 return true; 1157 return true;
1158 } 1158 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698