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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 14846020: Add Views implementation of ProfileSigninConfirmationDialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove default button 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/sync/one_click_signin_sync_starter.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
index dc1b99838f723cee569fc91ca919e0446c5ea41f..b2f7e5dc8203d76365e6d29d2d41e6317a814f6d 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -23,10 +23,12 @@
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/sync_prefs.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h"
@@ -140,7 +142,21 @@ void OneClickSigninSyncStarter::OnRegisteredForPolicy(
policy_client_.swap(client);
// Allow user to create a new profile before continuing with sign-in.
- ProfileSigninConfirmationDialog::ShowDialog(
+ Browser* browser =
+ chrome::FindBrowserWithProfile(profile_, chrome::GetActiveDesktop());
+ if (!browser) {
+ CancelSigninAndDelete();
+ return;
+ }
+ content::WebContents* web_contents =
+ browser->tab_strip_model()->GetActiveWebContents();
+ if (!web_contents) {
+ CancelSigninAndDelete();
+ return;
+ }
+ chrome::ShowProfileSigninConfirmationDialog(
+ browser,
+ web_contents,
profile_,
signin->GetUsernameForAuthInProgress(),
base::Bind(&OneClickSigninSyncStarter::CancelSigninAndDelete,

Powered by Google App Engine
This is Rietveld 408576698