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

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: more nits 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
« no previous file with comments | « chrome/browser/ui/browser_dialogs.h ('k') | chrome/browser/ui/sync/profile_signin_confirmation_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8241c75815bc3958e1192f4ca790d2efb71e91af..df57a20dbb1f9e0c9f3e633ba09de9bf7ce83e85 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,
« no previous file with comments | « chrome/browser/ui/browser_dialogs.h ('k') | chrome/browser/ui/sync/profile_signin_confirmation_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698