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

Side by Side Diff: sky/engine/web/WebViewImpl.cpp

Issue 866213004: Switch Sky to pointer events (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: nits Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 30 matching lines...) Expand all
41 #include "sky/engine/core/editing/Editor.h" 41 #include "sky/engine/core/editing/Editor.h"
42 #include "sky/engine/core/editing/FrameSelection.h" 42 #include "sky/engine/core/editing/FrameSelection.h"
43 #include "sky/engine/core/editing/HTMLInterchange.h" 43 #include "sky/engine/core/editing/HTMLInterchange.h"
44 #include "sky/engine/core/editing/InputMethodController.h" 44 #include "sky/engine/core/editing/InputMethodController.h"
45 #include "sky/engine/core/editing/TextIterator.h" 45 #include "sky/engine/core/editing/TextIterator.h"
46 #include "sky/engine/core/events/KeyboardEvent.h" 46 #include "sky/engine/core/events/KeyboardEvent.h"
47 #include "sky/engine/core/events/WheelEvent.h" 47 #include "sky/engine/core/events/WheelEvent.h"
48 #include "sky/engine/core/frame/FrameHost.h" 48 #include "sky/engine/core/frame/FrameHost.h"
49 #include "sky/engine/core/frame/FrameView.h" 49 #include "sky/engine/core/frame/FrameView.h"
50 #include "sky/engine/core/frame/LocalFrame.h" 50 #include "sky/engine/core/frame/LocalFrame.h"
51 #include "sky/engine/core/frame/NewEventHandler.h"
51 #include "sky/engine/core/frame/Settings.h" 52 #include "sky/engine/core/frame/Settings.h"
52 #include "sky/engine/core/html/HTMLImportElement.h" 53 #include "sky/engine/core/html/HTMLImportElement.h"
53 #include "sky/engine/core/html/ime/InputMethodContext.h" 54 #include "sky/engine/core/html/ime/InputMethodContext.h"
54 #include "sky/engine/core/loader/FrameLoader.h" 55 #include "sky/engine/core/loader/FrameLoader.h"
55 #include "sky/engine/core/loader/UniqueIdentifier.h" 56 #include "sky/engine/core/loader/UniqueIdentifier.h"
56 #include "sky/engine/core/page/AutoscrollController.h" 57 #include "sky/engine/core/page/AutoscrollController.h"
57 #include "sky/engine/core/page/Chrome.h" 58 #include "sky/engine/core/page/Chrome.h"
58 #include "sky/engine/core/page/EventHandler.h" 59 #include "sky/engine/core/page/EventHandler.h"
59 #include "sky/engine/core/page/EventWithHitTestResults.h" 60 #include "sky/engine/core/page/EventWithHitTestResults.h"
60 #include "sky/engine/core/page/FocusController.h" 61 #include "sky/engine/core/page/FocusController.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 return String("unknown"); 596 return String("unknown");
596 } 597 }
597 } 598 }
598 599
599 bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) 600 bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
600 { 601 {
601 TRACE_EVENT1("input", "WebViewImpl::handleInputEvent", "type", inputTypeToNa me(inputEvent.type).ascii().data()); 602 TRACE_EVENT1("input", "WebViewImpl::handleInputEvent", "type", inputTypeToNa me(inputEvent.type).ascii().data());
602 603
603 TemporaryChange<const WebInputEvent*> currentEventChange(m_currentInputEvent , &inputEvent); 604 TemporaryChange<const WebInputEvent*> currentEventChange(m_currentInputEvent , &inputEvent);
604 605
606 if (WebInputEvent::isPointerEventType(inputEvent.type)) {
607 const WebPointerEvent& event = static_cast<const WebPointerEvent&>(input Event);
608 return m_page->mainFrame()->newEventHandler().handlePointerEvent(event);
609 }
610
605 if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type)) { 611 if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type)) {
606 TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type); 612 TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type);
607 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it. 613 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it.
608 RefPtr<Node> node = m_mouseCaptureNode; 614 RefPtr<Node> node = m_mouseCaptureNode;
609 615
610 // Not all platforms call mouseCaptureLost() directly. 616 // Not all platforms call mouseCaptureLost() directly.
611 if (inputEvent.type == WebInputEvent::MouseUp) 617 if (inputEvent.type == WebInputEvent::MouseUp)
612 mouseCaptureLost(); 618 mouseCaptureLost();
613 619
614 AtomicString eventType; 620 AtomicString eventType;
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, 1278 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState,
1273 bool isInitialState) { 1279 bool isInitialState) {
1274 if (!page()) 1280 if (!page())
1275 return; 1281 return;
1276 1282
1277 ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState = = WebPageVisibilityStateHidden); 1283 ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState = = WebPageVisibilityStateHidden);
1278 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int> (visibilityState)), isInitialState); 1284 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int> (visibilityState)), isInitialState);
1279 } 1285 }
1280 1286
1281 } // namespace blink 1287 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698