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

Unified Diff: chrome/browser/first_run_win.cc

Issue 155168: Fix for the default browser info-bar showing after first run (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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_mac.mm ('k') | chrome/browser/views/first_run_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run_win.cc
===================================================================
--- chrome/browser/first_run_win.cc (revision 20029)
+++ chrome/browser/first_run_win.cc (working copy)
@@ -340,13 +340,17 @@
return false;
}
-void OpenFirstRunDialog(Profile* profile,
+bool OpenFirstRunDialog(Profile* profile,
ProcessSingleton* process_singleton) {
DCHECK(profile);
DCHECK(process_singleton);
+ // We need the FirstRunView to outlive its parent, as we retrieve the accept
+ // state from it after the dialog has been closed.
+ scoped_ptr<FirstRunView> first_run_view(new FirstRunView(profile));
+ first_run_view->SetParentOwned(false);
views::Window* first_run_ui = views::Window::CreateChromeWindow(
- NULL, gfx::Rect(), new FirstRunView(profile));
+ NULL, gfx::Rect(), first_run_view.get());
DCHECK(first_run_ui);
// We need to avoid dispatching new tabs when we are doing the import
@@ -363,6 +367,8 @@
// that keyboard accelerators (Enter, Esc, etc) work in the dialog box.
MessageLoopForUI::current()->Run(g_browser_process->accelerator_handler());
process_singleton->Unlock();
+
+ return first_run_view->accepted();
}
namespace {
« no previous file with comments | « chrome/browser/first_run_mac.mm ('k') | chrome/browser/views/first_run_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698