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

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

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
Index: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index dea6584ab0a908b8dc32b2113a245783faed00b3..b8812f5ba5b34e147f84df08014daeb296c9320b 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -310,7 +310,7 @@ const WebInputEvent* WebFrameWidgetImpl::m_currentInputEvent = nullptr;
WebInputEventResult WebFrameWidgetImpl::handleInputEvent(
const WebInputEvent& inputEvent) {
TRACE_EVENT1("input", "WebFrameWidgetImpl::handleInputEvent", "type",
- WebInputEvent::GetName(inputEvent.type));
+ WebInputEvent::GetName(inputEvent.type()));
// If a drag-and-drop operation is in progress, ignore input events.
if (m_doingDragAndDrop)
@@ -335,19 +335,20 @@ WebInputEventResult WebFrameWidgetImpl::handleInputEvent(
AutoReset<const WebInputEvent*> currentEventChange(&m_currentInputEvent,
&inputEvent);
- if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type)) {
- TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type);
+ if (m_mouseCaptureNode &&
+ WebInputEvent::isMouseEventType(inputEvent.type())) {
+ TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type());
// Save m_mouseCaptureNode since mouseCaptureLost() will clear it.
Node* node = m_mouseCaptureNode;
// Not all platforms call mouseCaptureLost() directly.
- if (inputEvent.type == WebInputEvent::MouseUp)
+ if (inputEvent.type() == WebInputEvent::MouseUp)
mouseCaptureLost();
std::unique_ptr<UserGestureIndicator> gestureIndicator;
AtomicString eventType;
- switch (inputEvent.type) {
+ switch (inputEvent.type()) {
case WebInputEvent::MouseMove:
eventType = EventTypeNames::mousemove;
break;
@@ -749,7 +750,7 @@ void WebFrameWidgetImpl::handleMouseDown(LocalFrame& mainFrame,
#if OS(MACOSX)
if (event.button == WebMouseEvent::Button::Right ||
(event.button == WebMouseEvent::Button::Left &&
- event.modifiers & WebMouseEvent::ControlKey))
+ event.modifiers() & WebMouseEvent::ControlKey))
mouseContextMenu(event);
#else
if (event.button == WebMouseEvent::Button::Right)
@@ -814,7 +815,7 @@ WebInputEventResult WebFrameWidgetImpl::handleGestureEvent(
const WebGestureEvent& event) {
WebInputEventResult eventResult = WebInputEventResult::NotHandled;
bool eventCancelled = false;
- switch (event.type) {
+ switch (event.type()) {
case WebInputEvent::GestureScrollBegin:
case WebInputEvent::GestureScrollEnd:
case WebInputEvent::GestureScrollUpdate:
@@ -844,9 +845,9 @@ WebInputEventResult WebFrameWidgetImpl::handleGestureEvent(
WebInputEventResult WebFrameWidgetImpl::handleKeyEvent(
const WebKeyboardEvent& event) {
- DCHECK((event.type == WebInputEvent::RawKeyDown) ||
- (event.type == WebInputEvent::KeyDown) ||
- (event.type == WebInputEvent::KeyUp));
+ DCHECK((event.type() == WebInputEvent::RawKeyDown) ||
+ (event.type() == WebInputEvent::KeyDown) ||
+ (event.type() == WebInputEvent::KeyUp));
// Please refer to the comments explaining the m_suppressNextKeypressEvent
// member.
@@ -871,7 +872,7 @@ WebInputEventResult WebFrameWidgetImpl::handleKeyEvent(
WebInputEventResult result = frame->eventHandler().keyEvent(event);
if (result != WebInputEventResult::NotHandled) {
- if (WebInputEvent::RawKeyDown == event.type) {
+ if (WebInputEvent::RawKeyDown == event.type()) {
// Suppress the next keypress event unless the focused node is a plugin
// node. (Flash needs these keypress events to handle non-US keyboards.)
Element* element = focusedElement();
@@ -893,14 +894,14 @@ WebInputEventResult WebFrameWidgetImpl::handleKeyEvent(
WebInputEvent::RawKeyDown;
bool isUnmodifiedMenuKey =
- !(event.modifiers & WebInputEvent::InputModifiers) &&
+ !(event.modifiers() & WebInputEvent::InputModifiers) &&
event.windowsKeyCode == VKEY_APPS;
- bool isShiftF10 = (event.modifiers & WebInputEvent::InputModifiers) ==
+ bool isShiftF10 = (event.modifiers() & WebInputEvent::InputModifiers) ==
WebInputEvent::ShiftKey &&
event.windowsKeyCode == VKEY_F10;
if ((isUnmodifiedMenuKey &&
- event.type == contextMenuKeyTriggeringEventType) ||
- (isShiftF10 && event.type == shiftF10TriggeringEventType)) {
+ event.type() == contextMenuKeyTriggeringEventType) ||
+ (isShiftF10 && event.type() == shiftF10TriggeringEventType)) {
view()->sendContextMenuEvent(event);
return WebInputEventResult::HandledSystem;
}
@@ -911,7 +912,7 @@ WebInputEventResult WebFrameWidgetImpl::handleKeyEvent(
WebInputEventResult WebFrameWidgetImpl::handleCharEvent(
const WebKeyboardEvent& event) {
- DCHECK_EQ(event.type, WebInputEvent::Char);
+ DCHECK_EQ(event.type(), WebInputEvent::Char);
// Please refer to the comments explaining the m_suppressNextKeypressEvent
// member. The m_suppressNextKeypressEvent is set if the KeyDown is
« no previous file with comments | « third_party/WebKit/Source/web/RemoteFrameClientImpl.cpp ('k') | third_party/WebKit/Source/web/WebInputEventConversion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698