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

Side by Side Diff: chrome/browser/ui/views/unhandled_keyboard_event_handler_aurax11.cc

Issue 10381145: WIP: Always update ui::AcceleratorManager Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/base/accelerators/accelerator_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" 5 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/browser/native_web_keyboard_event.h" 8 #include "content/public/browser/native_web_keyboard_event.h"
9 #include "ui/views/focus/focus_manager.h" 9 #include "ui/views/focus/focus_manager.h"
10 10
11 using content::NativeWebKeyboardEvent; 11 using content::NativeWebKeyboardEvent;
12 12
13 UnhandledKeyboardEventHandler::UnhandledKeyboardEventHandler() { 13 UnhandledKeyboardEventHandler::UnhandledKeyboardEventHandler() {
14 } 14 }
15 15
16 void UnhandledKeyboardEventHandler::HandleKeyboardEvent( 16 void UnhandledKeyboardEventHandler::HandleKeyboardEvent(
17 const NativeWebKeyboardEvent& event, 17 const NativeWebKeyboardEvent& event,
18 views::FocusManager* focus_manager) { 18 views::FocusManager* focus_manager) {
19 if (!focus_manager) { 19 if (!focus_manager) {
20 NOTREACHED(); 20 NOTREACHED();
21 return; 21 return;
22 } 22 }
23 if (event.os_event && !event.skip_in_browser) { 23 if (event.os_event && !event.skip_in_browser) {
24 views::KeyEvent views_event(event.os_event); 24 views::KeyEvent views_event(event.os_event);
25 focus_manager->OnKeyEvent(views_event); 25 focus_manager->OnKeyEvent(views_event);
26 ui::Accelerator accelerator(views_event.key_code(),
27 views_event.IsShiftDown(),
28 views_event.IsControlDown(),
29 views_event.IsAltDown());
30 accelerator.set_type(views_event.type());
31 focus_manager->accelerator_manager()->set_last_event(accelerator);
26 } 32 }
27 } 33 }
OLDNEW
« no previous file with comments | « no previous file | ui/base/accelerators/accelerator_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698