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

Unified Diff: ash/accelerators/accelerator_delegate.cc

Issue 312483002: More accelerator code leanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | ash/accelerators/accelerator_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_delegate.cc
diff --git a/ash/accelerators/accelerator_delegate.cc b/ash/accelerators/accelerator_delegate.cc
index 687c2f0385fd874ff36b6eb5735323b295ac346c..234b8ba9aa106be1256f079a04fc26375cf72033 100644
--- a/ash/accelerators/accelerator_delegate.cc
+++ b/ash/accelerators/accelerator_delegate.cc
@@ -49,8 +49,7 @@ bool AcceleratorDelegate::ProcessAccelerator(const ui::KeyEvent& key_event,
// containing parent window will be checked for the property.
bool AcceleratorDelegate::CanConsumeSystemKeys(const ui::KeyEvent& event) {
aura::Window* target = static_cast<aura::Window*>(event.target());
- if (!target) // Can be NULL in tests.
- return false;
+ DCHECK(target);
aura::Window* top_level = ::wm::GetToplevelWindow(target);
return top_level && wm::GetWindowState(top_level)->can_consume_system_keys();
}
@@ -61,8 +60,7 @@ bool AcceleratorDelegate::ShouldProcessAcceleratorNow(
const ui::KeyEvent& event,
const ui::Accelerator& accelerator) {
aura::Window* target = static_cast<aura::Window*>(event.target());
- if (!target)
- return true;
+ DCHECK(target);
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
if (std::find(root_windows.begin(), root_windows.end(), target) !=
« no previous file with comments | « no previous file | ash/accelerators/accelerator_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698