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

Side by Side Diff: content/browser/renderer_host/native_web_keyboard_event.cc

Issue 10827441: Add support for Command key for Extension Commands (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
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 "content/public/browser/native_web_keyboard_event.h" 5 #include "content/public/browser/native_web_keyboard_event.h"
6 6
7 #include "ui/base/events.h" 7 #include "ui/base/events.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 int GetModifiersFromNativeWebKeyboardEvent( 11 int GetModifiersFromNativeWebKeyboardEvent(
12 const NativeWebKeyboardEvent& event) { 12 const NativeWebKeyboardEvent& event) {
13 int modifiers = ui::EF_NONE; 13 int modifiers = ui::EF_NONE;
14 if (event.modifiers & NativeWebKeyboardEvent::ShiftKey) 14 if (event.modifiers & NativeWebKeyboardEvent::ShiftKey)
15 modifiers |= ui::EF_SHIFT_DOWN; 15 modifiers |= ui::EF_SHIFT_DOWN;
16 if (event.modifiers & NativeWebKeyboardEvent::ControlKey) 16 if (event.modifiers & NativeWebKeyboardEvent::ControlKey)
17 modifiers |= ui::EF_CONTROL_DOWN; 17 modifiers |= ui::EF_CONTROL_DOWN;
18 if (event.modifiers & NativeWebKeyboardEvent::AltKey) 18 if (event.modifiers & NativeWebKeyboardEvent::AltKey)
19 modifiers |= ui::EF_ALT_DOWN; 19 modifiers |= ui::EF_ALT_DOWN;
20 #if defined(OS_MACOSX)
Nico 2012/08/22 14:30:49 Same question here.
21 if (event.modifiers & NativeWebKeyboardEvent::MetaKey)
22 modifiers |= ui::EF_COMMAND_DOWN;
23 #endif
20 return modifiers; 24 return modifiers;
21 } 25 }
22 26
23 } // namespace content 27 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698