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

Unified Diff: ui/content_accelerators/accelerator_util.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/public/platform/WebInputEvent.h ('k') | ui/events/blink/blink_event_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/content_accelerators/accelerator_util.cc
diff --git a/ui/content_accelerators/accelerator_util.cc b/ui/content_accelerators/accelerator_util.cc
index f6c99fa01a8467572a9164f4976507390ed00c08..4e9d0b4065b38fc372e3b81255ce26be886f48bb 100644
--- a/ui/content_accelerators/accelerator_util.cc
+++ b/ui/content_accelerators/accelerator_util.cc
@@ -16,14 +16,14 @@ namespace {
int GetModifiersFromNativeWebKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
int modifiers = ui::EF_NONE;
- if (event.modifiers & content::NativeWebKeyboardEvent::ShiftKey)
+ if (event.modifiers() & content::NativeWebKeyboardEvent::ShiftKey)
modifiers |= ui::EF_SHIFT_DOWN;
- if (event.modifiers & content::NativeWebKeyboardEvent::ControlKey)
+ if (event.modifiers() & content::NativeWebKeyboardEvent::ControlKey)
modifiers |= ui::EF_CONTROL_DOWN;
- if (event.modifiers & content::NativeWebKeyboardEvent::AltKey)
+ if (event.modifiers() & content::NativeWebKeyboardEvent::AltKey)
modifiers |= ui::EF_ALT_DOWN;
#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
- if (event.modifiers & content::NativeWebKeyboardEvent::MetaKey)
+ if (event.modifiers() & content::NativeWebKeyboardEvent::MetaKey)
modifiers |= ui::EF_COMMAND_DOWN;
#endif
#if defined(USE_AURA)
@@ -40,7 +40,7 @@ ui::Accelerator GetAcceleratorFromNativeWebKeyboardEvent(
ui::Accelerator accelerator(
static_cast<ui::KeyboardCode>(event.windowsKeyCode),
GetModifiersFromNativeWebKeyboardEvent(event));
- if (event.type == blink::WebInputEvent::KeyUp)
+ if (event.type() == blink::WebInputEvent::KeyUp)
accelerator.set_type(ui::ET_KEY_RELEASED);
return accelerator;
}
« no previous file with comments | « third_party/WebKit/public/platform/WebInputEvent.h ('k') | ui/events/blink/blink_event_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698