Chromium Code Reviews| 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..068df48407f806234387372d074259f845144a0d 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,23 @@ 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) { |
| + DLOG(WARNING) << "No browser found to display the confirmation dialog"; |
|
Peter Kasting
2013/05/15 00:11:03
In most Chrome code we try to avoid logging becaus
Andrew T Wilson (Slow)
2013/05/16 08:00:30
Do we really have any restrictions on adding DLOGs
Peter Kasting
2013/05/16 21:57:39
In the particular code here, it seems like either
dconnelly
2013/05/17 13:01:55
Done: removed the logging and kept the handling.
|
| + CancelSigninAndDelete(); |
| + return; |
| + } |
| + content::WebContents* web_contents = |
| + browser->tab_strip_model()->GetActiveWebContents(); |
| + if (!web_contents) { |
| + DLOG(WARNING) << "No web contents found to display the confirmation dialog"; |
| + CancelSigninAndDelete(); |
| + return; |
| + } |
| + chrome::ShowProfileSigninConfirmationDialog( |
| + browser, |
| + web_contents, |
| profile_, |
| signin->GetUsernameForAuthInProgress(), |
| base::Bind(&OneClickSigninSyncStarter::CancelSigninAndDelete, |