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

Side by Side Diff: content/renderer/render_widget.cc

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 // 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 "content/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) 624 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects)
625 IPC_MESSAGE_HANDLER(ViewMsg_WaitForNextFrameForTests, 625 IPC_MESSAGE_HANDLER(ViewMsg_WaitForNextFrameForTests,
626 OnWaitNextFrameForTests) 626 OnWaitNextFrameForTests)
627 IPC_MESSAGE_HANDLER(InputMsg_RequestCompositionUpdate, 627 IPC_MESSAGE_HANDLER(InputMsg_RequestCompositionUpdate,
628 OnRequestCompositionUpdate) 628 OnRequestCompositionUpdate)
629 IPC_MESSAGE_HANDLER(ViewMsg_HandleCompositorProto, OnHandleCompositorProto) 629 IPC_MESSAGE_HANDLER(ViewMsg_HandleCompositorProto, OnHandleCompositorProto)
630 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) 630 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter)
631 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) 631 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver)
632 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) 632 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave)
633 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) 633 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop)
634 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded)
635 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded,
636 OnDragSourceSystemDragEnded)
634 #if defined(OS_ANDROID) 637 #if defined(OS_ANDROID)
635 IPC_MESSAGE_HANDLER(InputMsg_ImeEventAck, OnImeEventAck) 638 IPC_MESSAGE_HANDLER(InputMsg_ImeEventAck, OnImeEventAck)
636 IPC_MESSAGE_HANDLER(InputMsg_RequestTextInputStateUpdate, 639 IPC_MESSAGE_HANDLER(InputMsg_RequestTextInputStateUpdate,
637 OnRequestTextInputStateUpdate) 640 OnRequestTextInputStateUpdate)
638 #endif 641 #endif
639 IPC_MESSAGE_UNHANDLED(handled = false) 642 IPC_MESSAGE_UNHANDLED(handled = false)
640 IPC_END_MESSAGE_MAP() 643 IPC_END_MESSAGE_MAP()
641 return handled; 644 return handled;
642 } 645 }
643 646
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 if (!GetWebWidget()) 1702 if (!GetWebWidget())
1700 return; 1703 return;
1701 1704
1702 DCHECK(GetWebWidget()->isWebFrameWidget()); 1705 DCHECK(GetWebWidget()->isWebFrameWidget());
1703 static_cast<WebFrameWidget*>(GetWebWidget())->dragTargetDrop( 1706 static_cast<WebFrameWidget*>(GetWebWidget())->dragTargetDrop(
1704 DropDataToWebDragData(drop_data), 1707 DropDataToWebDragData(drop_data),
1705 ConvertWindowPointToViewport(client_point), 1708 ConvertWindowPointToViewport(client_point),
1706 screen_point, key_modifiers); 1709 screen_point, key_modifiers);
1707 } 1710 }
1708 1711
1712 void RenderWidget::OnDragSourceEnded(const gfx::Point& client_point,
1713 const gfx::Point& screen_point,
1714 WebDragOperation op) {
1715 if (!GetWebWidget())
1716 return;
1717
1718 static_cast<WebFrameWidget*>(GetWebWidget())->dragSourceEndedAt(
1719 ConvertWindowPointToViewport(client_point), screen_point, op);
1720 }
1721
1722 void RenderWidget::OnDragSourceSystemDragEnded() {
1723 if (!GetWebWidget())
1724 return;
1725
1726 static_cast<WebFrameWidget*>(GetWebWidget())->dragSourceSystemDragEnded();
1727 }
1728
1709 void RenderWidget::showImeIfNeeded() { 1729 void RenderWidget::showImeIfNeeded() {
1710 #if defined(OS_ANDROID) || defined(USE_AURA) 1730 #if defined(OS_ANDROID) || defined(USE_AURA)
1711 UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_NON_IME); 1731 UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_NON_IME);
1712 #endif 1732 #endif
1713 1733
1714 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with 1734 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with
1715 // virtual keyboard. 1735 // virtual keyboard.
1716 #if !defined(OS_ANDROID) 1736 #if !defined(OS_ANDROID)
1717 FocusChangeComplete(); 1737 FocusChangeComplete();
1718 #endif 1738 #endif
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
2286 blink::WebInputMethodController* RenderWidget::GetInputMethodController() 2306 blink::WebInputMethodController* RenderWidget::GetInputMethodController()
2287 const { 2307 const {
2288 // TODO(ekaramad): Remove this CHECK when GetWebWidget() is 2308 // TODO(ekaramad): Remove this CHECK when GetWebWidget() is
2289 // always a WebFrameWidget. 2309 // always a WebFrameWidget.
2290 CHECK(GetWebWidget()->isWebFrameWidget()); 2310 CHECK(GetWebWidget()->isWebFrameWidget());
2291 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) 2311 return static_cast<blink::WebFrameWidget*>(GetWebWidget())
2292 ->getActiveWebInputMethodController(); 2312 ->getActiveWebInputMethodController();
2293 } 2313 }
2294 2314
2295 } // namespace content 2315 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698