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

Unified Diff: chrome/browser/first_run/try_chrome_dialog_view.cc

Issue 12096114: Extract locking behaviour from ProcessSingleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restrict chrome_process_singleton_unittest to WIN for now. Created 7 years, 8 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/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 114628c41a8074c6e57b0f747e0565424c30bb07..70e6342c6f0c8bd27649e3ce77cfaeda470ba7f0 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();
@@ -297,14 +297,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->SetActiveModalDialog(popup_->GetNativeView());
+ // Time to show the window in a modal loop.
popup_->Show();
+ if (!listener.is_null())
+ listener.Run(popup_->GetNativeView());
MessageLoop::current()->Run();
- process_singleton->SetActiveModalDialog(NULL);
+ if (!listener.is_null())
+ listener.Run(NULL);
return result_;
}

Powered by Google App Engine
This is Rietveld 408576698