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

Unified Diff: chrome/browser/ui/views/first_run_dialog.cc

Issue 182753002: Revert of Use the default dispatcher where possible for nested message loops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/ui/views/first_run_dialog.h ('k') | chrome/browser/ui/views/simple_message_box_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « chrome/browser/ui/views/first_run_dialog.h ('k') | chrome/browser/ui/views/simple_message_box_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698