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

Side by Side Diff: ui/events/event_handler.cc

Issue 727583002: Regression: Search+Key pops up app launcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/event_handler.h" 5 #include "ui/events/event_handler.h"
6 6
7 #include "ui/base/accelerators/accelerator_history.h"
7 #include "ui/events/event.h" 8 #include "ui/events/event.h"
8 #include "ui/events/event_dispatcher.h" 9 #include "ui/events/event_dispatcher.h"
9 10
10 namespace ui { 11 namespace ui {
11 12
12 EventHandler::EventHandler() { 13 EventHandler::EventHandler() {
13 } 14 }
14 15
15 EventHandler::~EventHandler() { 16 EventHandler::~EventHandler() {
16 while (!dispatchers_.empty()) { 17 while (!dispatchers_.empty()) {
17 EventDispatcher* dispatcher = dispatchers_.top(); 18 EventDispatcher* dispatcher = dispatchers_.top();
18 dispatchers_.pop(); 19 dispatchers_.pop();
19 dispatcher->OnHandlerDestroyed(this); 20 dispatcher->OnHandlerDestroyed(this);
20 } 21 }
21 } 22 }
22 23
23 void EventHandler::OnEvent(Event* event) { 24 void EventHandler::OnEvent(Event* event) {
24 // TODO(tdanderson): Encapsulate static_casts in ui::Event for all 25 // TODO(tdanderson): Encapsulate static_casts in ui::Event for all
25 // event types. 26 // event types.
26 if (event->IsKeyEvent()) 27 if (event->IsKeyEvent()) {
28 AcceleratorHistory::GetInstance()->BuildCurrentAccelerator(
29 static_cast<const KeyEvent&>(*event));
27 OnKeyEvent(static_cast<KeyEvent*>(event)); 30 OnKeyEvent(static_cast<KeyEvent*>(event));
28 else if (event->IsMouseEvent()) 31 } else if (event->IsMouseEvent())
29 OnMouseEvent(static_cast<MouseEvent*>(event)); 32 OnMouseEvent(static_cast<MouseEvent*>(event));
30 else if (event->IsScrollEvent()) 33 else if (event->IsScrollEvent())
31 OnScrollEvent(static_cast<ScrollEvent*>(event)); 34 OnScrollEvent(static_cast<ScrollEvent*>(event));
32 else if (event->IsTouchEvent()) 35 else if (event->IsTouchEvent())
33 OnTouchEvent(static_cast<TouchEvent*>(event)); 36 OnTouchEvent(static_cast<TouchEvent*>(event));
34 else if (event->IsGestureEvent()) 37 else if (event->IsGestureEvent())
35 OnGestureEvent(event->AsGestureEvent()); 38 OnGestureEvent(event->AsGestureEvent());
36 else if (event->type() == ET_CANCEL_MODE) 39 else if (event->type() == ET_CANCEL_MODE)
37 OnCancelMode(static_cast<CancelModeEvent*>(event)); 40 OnCancelMode(static_cast<CancelModeEvent*>(event));
38 } 41 }
(...skipping 10 matching lines...) Expand all
49 void EventHandler::OnTouchEvent(TouchEvent* event) { 52 void EventHandler::OnTouchEvent(TouchEvent* event) {
50 } 53 }
51 54
52 void EventHandler::OnGestureEvent(GestureEvent* event) { 55 void EventHandler::OnGestureEvent(GestureEvent* event) {
53 } 56 }
54 57
55 void EventHandler::OnCancelMode(CancelModeEvent* event) { 58 void EventHandler::OnCancelMode(CancelModeEvent* event) {
56 } 59 }
57 60
58 } // namespace ui 61 } // namespace ui
OLDNEW
« ui/events/DEPS ('K') | « ui/events/DEPS ('k') | ui/views/focus/focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698