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

Side by Side Diff: ui/views/controls/menu/menu_key_event_handler.cc

Issue 2155243007: Turn Bookmark Menus Async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge the pretarget handlers Created 4 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/views/controls/menu/menu_key_event_handler.h"
6
7 #include "ui/aura/env.h"
8 #include "ui/views/controls/menu/menu_controller.h"
9 #include "ui/views/views_delegate.h"
10
11 namespace views {
12
13 MenuKeyEventHandler::MenuKeyEventHandler() {
14 aura::Env::GetInstanceDontCreate()->PrependPreTargetHandler(this);
15 }
16
17 MenuKeyEventHandler::~MenuKeyEventHandler() {
18 aura::Env::GetInstanceDontCreate()->RemovePreTargetHandler(this);
19 }
20
21 void MenuKeyEventHandler::OnKeyEvent(ui::KeyEvent* event) {
22 MenuController* menu_controller = MenuController::GetActiveInstance();
23 DCHECK(menu_controller);
24 menu_controller->OnWillDispatchKeyEvent(event);
25 }
26
27 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_key_event_handler.h ('k') | ui/views/controls/menu/menu_message_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698