summaryrefslogtreecommitdiffstats
path: root/ash/accelerators/accelerator_delegate.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-03 17:17:01 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-03 17:17:01 +0000
commit25e073fe10cbfab109912d55b6258060edb6b625 (patch)
tree4c44e1852d1b12b7b85545c5d1bbe41012f73564 /ash/accelerators/accelerator_delegate.cc
parentf650ac2471230b43d060cff6318c539627d31183 (diff)
downloadchromium_src-25e073fe10cbfab109912d55b6258060edb6b625.zip
chromium_src-25e073fe10cbfab109912d55b6258060edb6b625.tar.gz
chromium_src-25e073fe10cbfab109912d55b6258060edb6b625.tar.bz2
More accelerator code leanup
* Remove null check * Simplify NestedAcceleratorDelegate interface. BUG=None R=sky@chromium.org Review URL: https://codereview.chromium.org/312483002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/accelerators/accelerator_delegate.cc')
-rw-r--r--ash/accelerators/accelerator_delegate.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/ash/accelerators/accelerator_delegate.cc b/ash/accelerators/accelerator_delegate.cc
index 687c2f0..234b8ba 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) !=