Index: chrome/browser/ui/views/first_run_dialog.cc |
diff --git a/chrome/browser/ui/views/first_run_dialog.cc b/chrome/browser/ui/views/first_run_dialog.cc |
index dc84312ae52f480cb14cf8141f2bad18e1e5492f..2a236b56e81ae576572a5f0d54a3194b799f0a7b 100644 |
--- a/chrome/browser/ui/views/first_run_dialog.cc |
+++ b/chrome/browser/ui/views/first_run_dialog.cc |
@@ -65,7 +65,7 @@ |
aura::Window* anchor = dialog->GetWidget()->GetNativeWindow(); |
aura::client::DispatcherClient* client = |
aura::client::GetDispatcherClient(anchor->GetRootWindow()); |
- client->RunWithDispatcher(NULL, anchor); |
+ client->RunWithDispatcher(dialog, anchor); |
dialog_shown = true; |
} |
#endif // defined(GOOGLE_CHROME_BUILD) |
@@ -76,7 +76,8 @@ |
FirstRunDialog::FirstRunDialog(Profile* profile) |
: profile_(profile), |
make_default_(NULL), |
- report_crashes_(NULL) { |
+ report_crashes_(NULL), |
+ should_show_dialog_(true) { |
GridLayout* layout = GridLayout::CreatePanel(this); |
SetLayoutManager(layout); |
@@ -101,13 +102,6 @@ |
FirstRunDialog::~FirstRunDialog() { |
} |
-void FirstRunDialog::Done() { |
- aura::Window* window = GetWidget()->GetNativeView(); |
- aura::client::DispatcherClient* client = |
- aura::client::GetDispatcherClient(window->GetRootWindow()); |
- client->QuitNestedMessageLoop(); |
-} |
- |
views::View* FirstRunDialog::CreateExtraView() { |
views::Link* link = new views::Link(l10n_util::GetStringUTF16( |
IDS_LEARN_MORE)); |
@@ -116,11 +110,12 @@ |
} |
void FirstRunDialog::OnClosed() { |
+ should_show_dialog_ = false; |
first_run::SetShouldShowWelcomePage(); |
- Done(); |
} |
bool FirstRunDialog::Accept() { |
+ should_show_dialog_ = false; |
GetWidget()->Hide(); |
if (report_crashes_ && report_crashes_->checked()) { |
@@ -133,7 +128,6 @@ |
if (make_default_ && make_default_->checked()) |
ShellIntegration::SetAsDefaultBrowser(); |
- Done(); |
return true; |
} |
@@ -144,3 +138,10 @@ |
void FirstRunDialog::LinkClicked(views::Link* source, int event_flags) { |
platform_util::OpenExternal(profile_, GURL(chrome::kLearnMoreReportingURL)); |
} |
+ |
+uint32_t FirstRunDialog::Dispatch(const base::NativeEvent& event) { |
+ uint32_t action = POST_DISPATCH_PERFORM_DEFAULT; |
+ if (!should_show_dialog_) |
+ action |= POST_DISPATCH_QUIT_LOOP; |
+ return action; |
+} |