Chromium Code Reviews| Index: chrome/browser/first_run/try_chrome_dialog_view.cc |
| diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc |
| index 11042a71cb7439093d64d428e432f8e7595937d0..b176ac1ffacd05ab00de8e56829a7ebbbf91bbae 100644 |
| --- a/chrome/browser/first_run/try_chrome_dialog_view.cc |
| +++ b/chrome/browser/first_run/try_chrome_dialog_view.cc |
| @@ -55,14 +55,14 @@ const int kRadioGroupID = 1; |
| // static |
| TryChromeDialogView::Result TryChromeDialogView::Show( |
| size_t flavor, |
| - ProcessSingleton* process_singleton) { |
| + const ActiveModalDialogListener& listener) { |
| if (flavor > 10000) { |
| // This is a test value. We want to make sure we exercise |
| // returning this early. See TryChromeDialogBrowserTest test. |
| return NOT_NOW; |
| } |
| TryChromeDialogView dialog(flavor); |
| - return dialog.ShowModal(process_singleton); |
| + return dialog.ShowModal(listener); |
| } |
| TryChromeDialogView::TryChromeDialogView(size_t flavor) |
| @@ -79,7 +79,7 @@ TryChromeDialogView::~TryChromeDialogView() { |
| } |
| TryChromeDialogView::Result TryChromeDialogView::ShowModal( |
| - ProcessSingleton* process_singleton) { |
| + const ActiveModalDialogListener& listener) { |
| ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| views::ImageView* icon = new views::ImageView(); |
| @@ -295,14 +295,13 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal( |
| #endif |
| SetToastRegion(toast_window, preferred.width(), preferred.height()); |
| - // Time to show the window in a modal loop. The ProcessSingleton should |
| - // already be locked and it will not process WM_COPYDATA requests. Change the |
| - // window to bring to foreground if a request arrives. |
| - CHECK(process_singleton->locked()); |
| - process_singleton->SetForegroundWindow(popup_->GetNativeView()); |
| + // Time to show the window in a modal loop. |
| popup_->Show(); |
| + if (!listener.is_null()) |
| + listener.Run(popup_->GetNativeView()); |
| MessageLoop::current()->Run(); |
|
gab
2013/03/27 18:03:26
We shouldn't run the MessageLoop before the end of
erikwright (departed)
2013/03/28 03:16:34
I'm sure a way could be found to do that, but keep
|
| - process_singleton->SetForegroundWindow(NULL); |
| + if (!listener.is_null()) |
| + listener.Run(NULL); |
| return result_; |
| } |