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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2501213002: Drag-and-drop: dragSourceEndedAt, dragSourceSystemDragEnded (Closed)
Patch Set: Rebased. Added check for !GetWebWidget(). Created 4 years, 1 month 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 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after
3393 HitTestResult WebViewImpl::coreHitTestResultAt( 3393 HitTestResult WebViewImpl::coreHitTestResultAt(
3394 const WebPoint& pointInViewport) { 3394 const WebPoint& pointInViewport) {
3395 DocumentLifecycle::AllowThrottlingScope throttlingScope( 3395 DocumentLifecycle::AllowThrottlingScope throttlingScope(
3396 mainFrameImpl()->frame()->document()->lifecycle()); 3396 mainFrameImpl()->frame()->document()->lifecycle());
3397 FrameView* view = mainFrameImpl()->frameView(); 3397 FrameView* view = mainFrameImpl()->frameView();
3398 IntPoint pointInRootFrame = 3398 IntPoint pointInRootFrame =
3399 view->contentsToFrame(view->viewportToContents(pointInViewport)); 3399 view->contentsToFrame(view->viewportToContents(pointInViewport));
3400 return hitTestResultForRootFramePos(pointInRootFrame); 3400 return hitTestResultForRootFramePos(pointInRootFrame);
3401 } 3401 }
3402 3402
3403 void WebViewImpl::dragSourceEndedAt(const WebPoint& pointInViewport,
3404 const WebPoint& screenPoint,
3405 WebDragOperation operation) {
3406 WebPoint pointInRootFrame(
3407 page()->frameHost().visualViewport().viewportToRootFrame(
3408 pointInViewport));
3409 PlatformMouseEvent pme(
3410 pointInRootFrame, screenPoint, WebPointerProperties::Button::Left,
3411 PlatformEvent::MouseMoved, 0, PlatformEvent::NoModifiers,
3412 PlatformMouseEvent::RealOrIndistinguishable,
3413 WTF::monotonicallyIncreasingTime());
3414 m_page->deprecatedLocalMainFrame()->eventHandler().dragSourceEndedAt(
3415 pme, static_cast<DragOperation>(operation));
3416 }
3417
3418 void WebViewImpl::dragSourceSystemDragEnded() {
3419 // It's possible for us to get this callback while not doing a drag if
3420 // it's from a previous page that got unloaded.
3421 if (m_doingDragAndDrop) {
3422 m_page->dragController().dragEnded();
3423 m_doingDragAndDrop = false;
3424 }
3425 }
3426
3427 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) { 3403 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) {
3428 Vector<uint32_t> result; 3404 Vector<uint32_t> result;
3429 for (Frame* frame = m_page->mainFrame(); frame; 3405 for (Frame* frame = m_page->mainFrame(); frame;
3430 frame = frame->tree().traverseNext()) { 3406 frame = frame->tree().traverseNext()) {
3431 if (!frame->isLocalFrame()) 3407 if (!frame->isLocalFrame())
3432 continue; 3408 continue;
3433 const DocumentMarkerVector& documentMarkers = 3409 const DocumentMarkerVector& documentMarkers =
3434 toLocalFrame(frame)->document()->markers().markers(); 3410 toLocalFrame(frame)->document()->markers().markers();
3435 for (size_t i = 0; i < documentMarkers.size(); ++i) 3411 for (size_t i = 0; i < documentMarkers.size(); ++i)
3436 result.append(documentMarkers[i]->hash()); 3412 result.append(documentMarkers[i]->hash());
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
4248 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4224 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4249 return nullptr; 4225 return nullptr;
4250 return focusedFrame; 4226 return focusedFrame;
4251 } 4227 }
4252 4228
4253 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4229 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4254 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4230 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4255 } 4231 }
4256 4232
4257 } // namespace blink 4233 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698