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

Unified Diff: ash/accelerators/accelerator_dispatcher.cc

Issue 192743007: Use the default dispatcher where possible for nested message loops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert change in SimpleMessageBoxViews. Created 6 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 | « ash/accelerators/accelerator_dispatcher.h ('k') | ash/accelerators/nested_dispatcher_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_dispatcher.cc
diff --git a/ash/accelerators/accelerator_dispatcher.cc b/ash/accelerators/accelerator_dispatcher.cc
index 0395ee7aabd0c1c4b78acd49501020b98fbba5d8..91ea13b86f28d306ee81326a306e7cc03b43c02c 100644
--- a/ash/accelerators/accelerator_dispatcher.cc
+++ b/ash/accelerators/accelerator_dispatcher.cc
@@ -70,7 +70,6 @@ AcceleratorDispatcher::AcceleratorDispatcher(
aura::Window* associated_window)
: nested_dispatcher_(nested_dispatcher),
associated_window_(associated_window) {
- DCHECK(nested_dispatcher_);
associated_window_->AddObserver(this);
}
@@ -121,10 +120,13 @@ uint32_t AcceleratorDispatcher::Dispatch(const base::NativeEvent& event) {
return POST_DISPATCH_NONE;
}
- return nested_dispatcher_->Dispatch(key_event.native_event());
+ return nested_dispatcher_
+ ? nested_dispatcher_->Dispatch(key_event.native_event())
+ : POST_DISPATCH_PERFORM_DEFAULT;
}
- return nested_dispatcher_->Dispatch(event);
+ return nested_dispatcher_ ? nested_dispatcher_->Dispatch(event)
+ : POST_DISPATCH_PERFORM_DEFAULT;
}
} // namespace ash
« no previous file with comments | « ash/accelerators/accelerator_dispatcher.h ('k') | ash/accelerators/nested_dispatcher_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698