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

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

Issue 6625037: Make the toast more reliable and less dangerous... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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/first_run/first_run.h ('k') | chrome/browser/process_singleton.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/first_run_win.cc
===================================================================
--- chrome/browser/first_run/first_run_win.cc (revision 76859)
+++ chrome/browser/first_run/first_run_win.cc (working copy)
@@ -622,7 +622,7 @@
// Shows the modal dialog asking the user to try chrome. Note that the dialog
// has no parent and it will position itself in a lower corner of the screen.
// The dialog does not steal focus and does not have an entry in the taskbar.
- Upgrade::TryResult ShowModal() {
+ Upgrade::TryResult ShowModal(ProcessSingleton* process_singleton) {
using views::GridLayout;
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
@@ -637,6 +637,7 @@
NOTREACHED();
return Upgrade::TD_DIALOG_ERROR;
}
+
popup->set_delete_on_destroy(true);
popup->set_window_style(WS_POPUP | WS_CLIPCHILDREN);
popup->set_window_ex_style(WS_EX_TOOLWINDOW);
@@ -767,10 +768,14 @@
// Carve the toast shape into the window.
SetToastRegion(popup->GetNativeView(),
preferred.width(), preferred.height());
- // Time to show the window in a modal loop.
popup_ = popup;
+
+ // Time to show the window in a modal loop. We don't want this chrome
+ // instance trying to serve WM_COPYDATA requests, as we'll surely crash.
+ process_singleton->Lock(popup->GetNativeView());
popup_->Show();
MessageLoop::current()->Run();
+ process_singleton->Unlock();
return result_;
}
@@ -859,12 +864,14 @@
} // namespace
-Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) {
+Upgrade::TryResult Upgrade::ShowTryChromeDialog(
+ size_t version,
+ ProcessSingleton* process_singleton) {
if (version > 10000) {
// This is a test value. We want to make sure we exercise
// returning this early. See EarlyReturnTest test harness.
return Upgrade::TD_NOT_NOW;
}
TryChromeDialog td(version);
- return td.ShowModal();
+ return td.ShowModal(process_singleton);
}
« no previous file with comments | « chrome/browser/first_run/first_run.h ('k') | chrome/browser/process_singleton.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698