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

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

Issue 182143002: Use the default dispatcher where possible for nested message loops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar-fix 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 2a236b56e81ae576572a5f0d54a3194b799f0a7b..dc84312ae52f480cb14cf8141f2bad18e1e5492f 100644
--- a/chrome/browser/ui/views/first_run_dialog.cc
+++ b/chrome/browser/ui/views/first_run_dialog.cc
@@ -65,7 +65,7 @@ bool FirstRunDialog::Show(Profile* profile) {
aura::Window* anchor = dialog->GetWidget()->GetNativeWindow();
aura::client::DispatcherClient* client =
aura::client::GetDispatcherClient(anchor->GetRootWindow());
- client->RunWithDispatcher(dialog, anchor);
+ client->RunWithDispatcher(NULL, anchor);
dialog_shown = true;
}
#endif // defined(GOOGLE_CHROME_BUILD)
@@ -76,8 +76,7 @@ bool FirstRunDialog::Show(Profile* profile) {
FirstRunDialog::FirstRunDialog(Profile* profile)
: profile_(profile),
make_default_(NULL),
- report_crashes_(NULL),
- should_show_dialog_(true) {
+ report_crashes_(NULL) {
GridLayout* layout = GridLayout::CreatePanel(this);
SetLayoutManager(layout);
@@ -102,6 +101,13 @@ FirstRunDialog::FirstRunDialog(Profile* profile)
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));
@@ -110,12 +116,11 @@ views::View* FirstRunDialog::CreateExtraView() {
}
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()) {
@@ -128,6 +133,7 @@ bool FirstRunDialog::Accept() {
if (make_default_ && make_default_->checked())
ShellIntegration::SetAsDefaultBrowser();
+ Done();
return true;
}
@@ -138,10 +144,3 @@ int FirstRunDialog::GetDialogButtons() const {
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