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

Side by Side Diff: ui/content_accelerators/accelerator_util.cc

Issue 1559163002: Clean up event flags a bit: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 4 years, 11 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
« no previous file with comments | « ui/base/ime/input_method_chromeos.cc ('k') | ui/events/android/motion_event_android.cc » ('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 "ui/content_accelerators/accelerator_util.h" 5 #include "ui/content_accelerators/accelerator_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "third_party/WebKit/public/web/WebInputEvent.h" 8 #include "third_party/WebKit/public/web/WebInputEvent.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_constants.h" 10 #include "ui/events/event_constants.h"
(...skipping 21 matching lines...) Expand all
32 } // namespace 32 } // namespace
33 33
34 ui::Accelerator GetAcceleratorFromNativeWebKeyboardEvent( 34 ui::Accelerator GetAcceleratorFromNativeWebKeyboardEvent(
35 const content::NativeWebKeyboardEvent& event) { 35 const content::NativeWebKeyboardEvent& event) {
36 ui::Accelerator accelerator( 36 ui::Accelerator accelerator(
37 static_cast<ui::KeyboardCode>(event.windowsKeyCode), 37 static_cast<ui::KeyboardCode>(event.windowsKeyCode),
38 GetModifiersFromNativeWebKeyboardEvent(event)); 38 GetModifiersFromNativeWebKeyboardEvent(event));
39 if (event.type == blink::WebInputEvent::KeyUp) 39 if (event.type == blink::WebInputEvent::KeyUp)
40 accelerator.set_type(ui::ET_KEY_RELEASED); 40 accelerator.set_type(ui::ET_KEY_RELEASED);
41 #if defined(USE_AURA) 41 #if defined(USE_AURA)
42 if (event.os_event && event.os_event->IsRepeat()) 42 if (event.os_event && static_cast<ui::KeyEvent*>(event.os_event)->is_repeat())
43 accelerator.set_is_repeat(true); 43 accelerator.set_is_repeat(true);
44 #endif 44 #endif
45 return accelerator; 45 return accelerator;
46 } 46 }
47 47
48 } // namespace ui 48 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_chromeos.cc ('k') | ui/events/android/motion_event_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698