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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 2590613002: Prevent drag-and-drop events from firing over cross-site, same-page frames. (Closed)
Patch Set: Created 4 years 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/browser/web_contents/web_contents_view_aura.h" 5 #include "content/browser/web_contents/web_contents_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 23 matching lines...) Expand all
34 #include "content/public/browser/notification_source.h" 34 #include "content/public/browser/notification_source.h"
35 #include "content/public/browser/notification_types.h" 35 #include "content/public/browser/notification_types.h"
36 #include "content/public/browser/overscroll_configuration.h" 36 #include "content/public/browser/overscroll_configuration.h"
37 #include "content/public/browser/render_view_host.h" 37 #include "content/public/browser/render_view_host.h"
38 #include "content/public/browser/render_widget_host.h" 38 #include "content/public/browser/render_widget_host.h"
39 #include "content/public/browser/render_widget_host_view.h" 39 #include "content/public/browser/render_widget_host_view.h"
40 #include "content/public/browser/web_contents_delegate.h" 40 #include "content/public/browser/web_contents_delegate.h"
41 #include "content/public/browser/web_contents_observer.h" 41 #include "content/public/browser/web_contents_observer.h"
42 #include "content/public/browser/web_contents_view_delegate.h" 42 #include "content/public/browser/web_contents_view_delegate.h"
43 #include "content/public/browser/web_drag_dest_delegate.h" 43 #include "content/public/browser/web_drag_dest_delegate.h"
44 #include "content/public/common/child_process_host.h"
44 #include "content/public/common/content_client.h" 45 #include "content/public/common/content_client.h"
45 #include "content/public/common/content_switches.h" 46 #include "content/public/common/content_switches.h"
46 #include "content/public/common/drop_data.h" 47 #include "content/public/common/drop_data.h"
47 #include "net/base/filename_util.h" 48 #include "net/base/filename_util.h"
48 #include "third_party/WebKit/public/platform/WebInputEvent.h" 49 #include "third_party/WebKit/public/platform/WebInputEvent.h"
49 #include "ui/aura/client/aura_constants.h" 50 #include "ui/aura/client/aura_constants.h"
50 #include "ui/aura/client/drag_drop_client.h" 51 #include "ui/aura/client/drag_drop_client.h"
51 #include "ui/aura/client/drag_drop_delegate.h" 52 #include "ui/aura/client/drag_drop_delegate.h"
52 #include "ui/aura/client/screen_position_client.h" 53 #include "ui/aura/client/screen_position_client.h"
53 #include "ui/aura/client/window_parenting_client.h" 54 #include "ui/aura/client/window_parenting_client.h"
(...skipping 15 matching lines...) Expand all
69 #include "ui/events/blink/web_input_event.h" 70 #include "ui/events/blink/web_input_event.h"
70 #include "ui/events/event.h" 71 #include "ui/events/event.h"
71 #include "ui/events/event_utils.h" 72 #include "ui/events/event_utils.h"
72 #include "ui/gfx/canvas.h" 73 #include "ui/gfx/canvas.h"
73 #include "ui/gfx/image/image.h" 74 #include "ui/gfx/image/image.h"
74 #include "ui/gfx/image/image_png_rep.h" 75 #include "ui/gfx/image/image_png_rep.h"
75 #include "ui/gfx/image/image_skia.h" 76 #include "ui/gfx/image/image_skia.h"
76 #include "ui/touch_selection/touch_selection_controller.h" 77 #include "ui/touch_selection/touch_selection_controller.h"
77 78
78 namespace content { 79 namespace content {
80
79 WebContentsView* CreateWebContentsView( 81 WebContentsView* CreateWebContentsView(
80 WebContentsImpl* web_contents, 82 WebContentsImpl* web_contents,
81 WebContentsViewDelegate* delegate, 83 WebContentsViewDelegate* delegate,
82 RenderViewHostDelegateView** render_view_host_delegate_view) { 84 RenderViewHostDelegateView** render_view_host_delegate_view) {
83 WebContentsViewAura* rv = new WebContentsViewAura(web_contents, delegate); 85 WebContentsViewAura* rv = new WebContentsViewAura(web_contents, delegate);
84 *render_view_host_delegate_view = rv; 86 *render_view_host_delegate_view = rv;
85 return rv; 87 return rv;
86 } 88 }
87 89
88 namespace { 90 namespace {
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 web_input_event_modifiers |= blink::WebInputEvent::MetaKey; 400 web_input_event_modifiers |= blink::WebInputEvent::MetaKey;
399 if (aura_event_flags & ui::EF_LEFT_MOUSE_BUTTON) 401 if (aura_event_flags & ui::EF_LEFT_MOUSE_BUTTON)
400 web_input_event_modifiers |= blink::WebInputEvent::LeftButtonDown; 402 web_input_event_modifiers |= blink::WebInputEvent::LeftButtonDown;
401 if (aura_event_flags & ui::EF_MIDDLE_MOUSE_BUTTON) 403 if (aura_event_flags & ui::EF_MIDDLE_MOUSE_BUTTON)
402 web_input_event_modifiers |= blink::WebInputEvent::MiddleButtonDown; 404 web_input_event_modifiers |= blink::WebInputEvent::MiddleButtonDown;
403 if (aura_event_flags & ui::EF_RIGHT_MOUSE_BUTTON) 405 if (aura_event_flags & ui::EF_RIGHT_MOUSE_BUTTON)
404 web_input_event_modifiers |= blink::WebInputEvent::RightButtonDown; 406 web_input_event_modifiers |= blink::WebInputEvent::RightButtonDown;
405 return web_input_event_modifiers; 407 return web_input_event_modifiers;
406 } 408 }
407 409
410 GlobalRoutingID GetRenderViewHostID(RenderViewHost* rvh) {
411 return GlobalRoutingID(rvh->GetProcess()->GetID(), rvh->GetRoutingID());
412 }
413
408 } // namespace 414 } // namespace
409 415
410 class WebContentsViewAura::WindowObserver 416 class WebContentsViewAura::WindowObserver
411 : public aura::WindowObserver, public aura::WindowTreeHostObserver { 417 : public aura::WindowObserver, public aura::WindowTreeHostObserver {
412 public: 418 public:
413 explicit WindowObserver(WebContentsViewAura* view) 419 explicit WindowObserver(WebContentsViewAura* view)
414 : view_(view), 420 : view_(view),
415 host_window_(NULL) { 421 host_window_(NULL) {
416 view_->window_->AddObserver(this); 422 view_->window_->AddObserver(this);
417 } 423 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 519
514 //////////////////////////////////////////////////////////////////////////////// 520 ////////////////////////////////////////////////////////////////////////////////
515 // WebContentsViewAura, public: 521 // WebContentsViewAura, public:
516 522
517 WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents, 523 WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents,
518 WebContentsViewDelegate* delegate) 524 WebContentsViewDelegate* delegate)
519 : web_contents_(web_contents), 525 : web_contents_(web_contents),
520 delegate_(delegate), 526 delegate_(delegate),
521 current_drag_op_(blink::WebDragOperationNone), 527 current_drag_op_(blink::WebDragOperationNone),
522 drag_dest_delegate_(nullptr), 528 drag_dest_delegate_(nullptr),
523 current_rvh_for_drag_(nullptr), 529 current_rvh_for_drag_(ChildProcessHost::kInvalidUniqueID,
530 MSG_ROUTING_NONE),
531 drag_start_process_id_(ChildProcessHost::kInvalidUniqueID),
532 drag_start_view_id_(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE),
524 current_overscroll_gesture_(OVERSCROLL_NONE), 533 current_overscroll_gesture_(OVERSCROLL_NONE),
525 completed_overscroll_gesture_(OVERSCROLL_NONE), 534 completed_overscroll_gesture_(OVERSCROLL_NONE),
526 navigation_overlay_(nullptr), 535 navigation_overlay_(nullptr),
527 init_rwhv_with_null_parent_for_testing_(false) {} 536 init_rwhv_with_null_parent_for_testing_(false) {}
528 537
529 void WebContentsViewAura::SetDelegateForTesting( 538 void WebContentsViewAura::SetDelegateForTesting(
530 WebContentsViewDelegate* delegate) { 539 WebContentsViewDelegate* delegate) {
531 delegate_.reset(delegate); 540 delegate_.reset(delegate);
532 } 541 }
533 542
(...skipping 16 matching lines...) Expand all
550 if (web_contents_->GetInterstitialPage()) 559 if (web_contents_->GetInterstitialPage())
551 web_contents_->GetInterstitialPage()->SetSize(size); 560 web_contents_->GetInterstitialPage()->SetSize(size);
552 RenderWidgetHostView* rwhv = 561 RenderWidgetHostView* rwhv =
553 web_contents_->GetRenderWidgetHostView(); 562 web_contents_->GetRenderWidgetHostView();
554 if (rwhv) 563 if (rwhv)
555 rwhv->SetSize(size); 564 rwhv->SetSize(size);
556 } 565 }
557 566
558 void WebContentsViewAura::EndDrag(RenderWidgetHost* source_rwh, 567 void WebContentsViewAura::EndDrag(RenderWidgetHost* source_rwh,
559 blink::WebDragOperationsMask ops) { 568 blink::WebDragOperationsMask ops) {
569 drag_start_process_id_ = ChildProcessHost::kInvalidUniqueID;
570 drag_start_view_id_ = GlobalRoutingID(ChildProcessHost::kInvalidUniqueID,
571 MSG_ROUTING_NONE);
572
560 if (!web_contents_) 573 if (!web_contents_)
561 return; 574 return;
562 575
563 aura::Window* window = GetContentNativeView(); 576 aura::Window* window = GetContentNativeView();
564 gfx::Point screen_loc = display::Screen::GetScreen()->GetCursorScreenPoint(); 577 gfx::Point screen_loc = display::Screen::GetScreen()->GetCursorScreenPoint();
565 gfx::Point client_loc = screen_loc; 578 gfx::Point client_loc = screen_loc;
566 aura::client::ScreenPositionClient* screen_position_client = 579 aura::client::ScreenPositionClient* screen_position_client =
567 aura::client::GetScreenPositionClient(window->GetRootWindow()); 580 aura::client::GetScreenPositionClient(window->GetRootWindow());
568 if (screen_position_client) 581 if (screen_position_client)
569 screen_position_client->ConvertPointFromScreen(window, &client_loc); 582 screen_position_client->ConvertPointFromScreen(window, &client_loc);
570 583
571 // TODO(paulmeyer): In the OOPIF case, should |client_loc| be converted to 584 // TODO(paulmeyer): In the OOPIF case, should |client_loc| be converted to the
572 // the coordinates local to |drag_start_rwh_|? See crbug.com/647249. 585 // coordinates local to |source_rwh|? See crbug.com/647249.
573 web_contents_->DragSourceEndedAt(client_loc.x(), client_loc.y(), 586 web_contents_->DragSourceEndedAt(client_loc.x(), client_loc.y(),
574 screen_loc.x(), screen_loc.y(), ops, 587 screen_loc.x(), screen_loc.y(), ops,
575 source_rwh); 588 source_rwh);
576 589
577 web_contents_->SystemDragEnded(source_rwh); 590 web_contents_->SystemDragEnded(source_rwh);
578 } 591 }
579 592
580 void WebContentsViewAura::InstallOverscrollControllerDelegate( 593 void WebContentsViewAura::InstallOverscrollControllerDelegate(
581 RenderWidgetHostViewAura* view) { 594 RenderWidgetHostViewAura* view) {
582 const std::string value = base::CommandLine::ForCurrentProcess()-> 595 const std::string value = base::CommandLine::ForCurrentProcess()->
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView()); 640 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView());
628 return view ? view->selection_controller_client() : nullptr; 641 return view ? view->selection_controller_client() : nullptr;
629 } 642 }
630 643
631 gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const { 644 gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
632 if (init_rwhv_with_null_parent_for_testing_) 645 if (init_rwhv_with_null_parent_for_testing_)
633 return nullptr; 646 return nullptr;
634 return window_.get(); 647 return window_.get();
635 } 648 }
636 649
650 bool WebContentsViewAura::IsValidDragTarget(
651 RenderWidgetHostImpl* target_rwh) const {
652 return target_rwh->GetProcess()->GetID() == drag_start_process_id_ ||
653 GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
654 drag_start_view_id_;
655 }
656
637 //////////////////////////////////////////////////////////////////////////////// 657 ////////////////////////////////////////////////////////////////////////////////
638 // WebContentsViewAura, WebContentsView implementation: 658 // WebContentsViewAura, WebContentsView implementation:
639 659
640 gfx::NativeView WebContentsViewAura::GetNativeView() const { 660 gfx::NativeView WebContentsViewAura::GetNativeView() const {
641 return window_.get(); 661 return window_.get();
642 } 662 }
643 663
644 gfx::NativeView WebContentsViewAura::GetContentNativeView() const { 664 gfx::NativeView WebContentsViewAura::GetContentNativeView() const {
645 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); 665 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView();
646 return rwhv ? rwhv->GetNativeView() : NULL; 666 return rwhv ? rwhv->GetNativeView() : NULL;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 } 920 }
901 921
902 // Grab a weak pointer to the RenderWidgetHost, since it can be destroyed 922 // Grab a weak pointer to the RenderWidgetHost, since it can be destroyed
903 // during the drag and drop nested message loop in StartDragAndDrop. 923 // during the drag and drop nested message loop in StartDragAndDrop.
904 // For example, the RenderWidgetHost can be deleted if a cross-process 924 // For example, the RenderWidgetHost can be deleted if a cross-process
905 // transfer happens while dragging, since the RenderWidgetHost is deleted in 925 // transfer happens while dragging, since the RenderWidgetHost is deleted in
906 // that case. 926 // that case.
907 base::WeakPtr<RenderWidgetHostImpl> source_rwh_weak_ptr = 927 base::WeakPtr<RenderWidgetHostImpl> source_rwh_weak_ptr =
908 source_rwh->GetWeakPtr(); 928 source_rwh->GetWeakPtr();
909 929
930 drag_start_process_id_ = source_rwh->GetProcess()->GetID();
931 drag_start_view_id_ = GetRenderViewHostID(web_contents_->GetRenderViewHost());
932
910 ui::TouchSelectionController* selection_controller = GetSelectionController(); 933 ui::TouchSelectionController* selection_controller = GetSelectionController();
911 if (selection_controller) 934 if (selection_controller)
912 selection_controller->HideAndDisallowShowingAutomatically(); 935 selection_controller->HideAndDisallowShowingAutomatically();
913 std::unique_ptr<ui::OSExchangeData::Provider> provider = 936 std::unique_ptr<ui::OSExchangeData::Provider> provider =
914 ui::OSExchangeDataProviderFactory::CreateProvider(); 937 ui::OSExchangeDataProviderFactory::CreateProvider();
915 PrepareDragData(drop_data, provider.get(), web_contents_); 938 PrepareDragData(drop_data, provider.get(), web_contents_);
916 939
917 ui::OSExchangeData data( 940 ui::OSExchangeData data(
918 std::move(provider)); // takes ownership of |provider|. 941 std::move(provider)); // takes ownership of |provider|.
919 942
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 web_contents_->GetDelegate()->ContentsMouseEvent( 1146 web_contents_->GetDelegate()->ContentsMouseEvent(
1124 web_contents_, display::Screen::GetScreen()->GetCursorScreenPoint(), 1147 web_contents_, display::Screen::GetScreen()->GetCursorScreenPoint(),
1125 type == ui::ET_MOUSE_MOVED, type == ui::ET_MOUSE_EXITED); 1148 type == ui::ET_MOUSE_MOVED, type == ui::ET_MOUSE_EXITED);
1126 } 1149 }
1127 1150
1128 //////////////////////////////////////////////////////////////////////////////// 1151 ////////////////////////////////////////////////////////////////////////////////
1129 // WebContentsViewAura, aura::client::DragDropDelegate implementation: 1152 // WebContentsViewAura, aura::client::DragDropDelegate implementation:
1130 1153
1131 void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) { 1154 void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) {
1132 gfx::Point transformed_pt; 1155 gfx::Point transformed_pt;
1133 current_rwh_for_drag_ = 1156 RenderWidgetHostImpl* target_rwh =
1134 web_contents_->GetInputEventRouter()->GetRenderWidgetHostAtPoint( 1157 web_contents_->GetInputEventRouter()->GetRenderWidgetHostAtPoint(
1135 web_contents_->GetRenderViewHost()->GetWidget()->GetView(), 1158 web_contents_->GetRenderViewHost()->GetWidget()->GetView(),
1136 event.location(), &transformed_pt)->GetWeakPtr(); 1159 event.location(), &transformed_pt);
1137 current_rvh_for_drag_ = web_contents_->GetRenderViewHost();
1138 1160
1161 if (!IsValidDragTarget(target_rwh))
1162 return;
1163
1164 current_rwh_for_drag_ = target_rwh->GetWeakPtr();
1165 current_rvh_for_drag_ =
1166 GetRenderViewHostID(web_contents_->GetRenderViewHost());
1139 current_drop_data_.reset(new DropData()); 1167 current_drop_data_.reset(new DropData());
1140 PrepareDropData(current_drop_data_.get(), event.data()); 1168 PrepareDropData(current_drop_data_.get(), event.data());
1141 current_rwh_for_drag_->FilterDropData(current_drop_data_.get()); 1169 current_rwh_for_drag_->FilterDropData(current_drop_data_.get());
1142 1170
1143 blink::WebDragOperationsMask op = ConvertToWeb(event.source_operations()); 1171 blink::WebDragOperationsMask op = ConvertToWeb(event.source_operations());
1144 1172
1145 // Give the delegate an opportunity to cancel the drag. 1173 // Give the delegate an opportunity to cancel the drag.
1146 if (web_contents_->GetDelegate() && 1174 if (web_contents_->GetDelegate() &&
1147 !web_contents_->GetDelegate()->CanDragEnter( 1175 !web_contents_->GetDelegate()->CanDragEnter(
1148 web_contents_, *current_drop_data_.get(), op)) { 1176 web_contents_, *current_drop_data_.get(), op)) {
(...skipping 15 matching lines...) Expand all
1164 } 1192 }
1165 } 1193 }
1166 1194
1167 int WebContentsViewAura::OnDragUpdated(const ui::DropTargetEvent& event) { 1195 int WebContentsViewAura::OnDragUpdated(const ui::DropTargetEvent& event) {
1168 gfx::Point transformed_pt; 1196 gfx::Point transformed_pt;
1169 RenderWidgetHostImpl* target_rwh = 1197 RenderWidgetHostImpl* target_rwh =
1170 web_contents_->GetInputEventRouter()->GetRenderWidgetHostAtPoint( 1198 web_contents_->GetInputEventRouter()->GetRenderWidgetHostAtPoint(
1171 web_contents_->GetRenderViewHost()->GetWidget()->GetView(), 1199 web_contents_->GetRenderViewHost()->GetWidget()->GetView(),
1172 event.location(), &transformed_pt); 1200 event.location(), &transformed_pt);
1173 1201
1202 if (!IsValidDragTarget(target_rwh))
1203 return ui::DragDropTypes::DRAG_NONE;
1204
1174 if (target_rwh != current_rwh_for_drag_.get()) { 1205 if (target_rwh != current_rwh_for_drag_.get()) {
1175 if (current_rwh_for_drag_) 1206 if (current_rwh_for_drag_)
1176 current_rwh_for_drag_->DragTargetDragLeave(); 1207 current_rwh_for_drag_->DragTargetDragLeave();
1177 OnDragEntered(event); 1208 OnDragEntered(event);
1178 } 1209 }
1179 1210
1180 if (!current_drop_data_) 1211 if (!current_drop_data_)
1181 return ui::DragDropTypes::DRAG_NONE; 1212 return ui::DragDropTypes::DRAG_NONE;
1182 1213
1183 blink::WebDragOperationsMask op = ConvertToWeb(event.source_operations()); 1214 blink::WebDragOperationsMask op = ConvertToWeb(event.source_operations());
1184 gfx::Point screen_pt = event.root_location(); 1215 gfx::Point screen_pt = event.root_location();
1185 target_rwh->DragTargetDragOver( 1216 target_rwh->DragTargetDragOver(
1186 transformed_pt, screen_pt, op, 1217 transformed_pt, screen_pt, op,
1187 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); 1218 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags()));
1188 1219
1189 if (drag_dest_delegate_) 1220 if (drag_dest_delegate_)
1190 drag_dest_delegate_->OnDragOver(); 1221 drag_dest_delegate_->OnDragOver();
1191 1222
1192 return ConvertFromWeb(current_drag_op_); 1223 return ConvertFromWeb(current_drag_op_);
1193 } 1224 }
1194 1225
1195 void WebContentsViewAura::OnDragExited() { 1226 void WebContentsViewAura::OnDragExited() {
1196 if (current_rvh_for_drag_ != web_contents_->GetRenderViewHost() || 1227 if (current_rvh_for_drag_ !=
1228 GetRenderViewHostID(web_contents_->GetRenderViewHost()) ||
1197 !current_drop_data_) { 1229 !current_drop_data_) {
1198 return; 1230 return;
1199 } 1231 }
1200 1232
1201 if (current_rwh_for_drag_) { 1233 if (current_rwh_for_drag_) {
1202 current_rwh_for_drag_->DragTargetDragLeave(); 1234 current_rwh_for_drag_->DragTargetDragLeave();
1203 current_rwh_for_drag_.reset(); 1235 current_rwh_for_drag_.reset();
1204 } 1236 }
1205 1237
1206 if (drag_dest_delegate_) 1238 if (drag_dest_delegate_)
1207 drag_dest_delegate_->OnDragLeave(); 1239 drag_dest_delegate_->OnDragLeave();
1208 1240
1209 current_drop_data_.reset(); 1241 current_drop_data_.reset();
1210 } 1242 }
1211 1243
1212 int WebContentsViewAura::OnPerformDrop(const ui::DropTargetEvent& event) { 1244 int WebContentsViewAura::OnPerformDrop(const ui::DropTargetEvent& event) {
1213 gfx::Point transformed_pt; 1245 gfx::Point transformed_pt;
1214 RenderWidgetHostImpl* target_rwh = 1246 RenderWidgetHostImpl* target_rwh =
1215 web_contents_->GetInputEventRouter()->GetRenderWidgetHostAtPoint( 1247 web_contents_->GetInputEventRouter()->GetRenderWidgetHostAtPoint(
1216 web_contents_->GetRenderViewHost()->GetWidget()->GetView(), 1248 web_contents_->GetRenderViewHost()->GetWidget()->GetView(),
1217 event.location(), &transformed_pt); 1249 event.location(), &transformed_pt);
1218 1250
1251 if (!IsValidDragTarget(target_rwh))
1252 return ui::DragDropTypes::DRAG_NONE;
1253
1219 if (target_rwh != current_rwh_for_drag_.get()) { 1254 if (target_rwh != current_rwh_for_drag_.get()) {
1220 if (current_rwh_for_drag_) 1255 if (current_rwh_for_drag_)
1221 current_rwh_for_drag_->DragTargetDragLeave(); 1256 current_rwh_for_drag_->DragTargetDragLeave();
1222 OnDragEntered(event); 1257 OnDragEntered(event);
1223 } 1258 }
1224 1259
1225 if (!current_drop_data_) 1260 if (!current_drop_data_)
1226 return ui::DragDropTypes::DRAG_NONE; 1261 return ui::DragDropTypes::DRAG_NONE;
1227 1262
1228 target_rwh->DragTargetDrop( 1263 target_rwh->DragTargetDrop(
(...skipping 26 matching lines...) Expand all
1255 bool allow_multiple_selection) { 1290 bool allow_multiple_selection) {
1256 NOTIMPLEMENTED() << " show " << items.size() << " menu items"; 1291 NOTIMPLEMENTED() << " show " << items.size() << " menu items";
1257 } 1292 }
1258 1293
1259 void WebContentsViewAura::HidePopupMenu() { 1294 void WebContentsViewAura::HidePopupMenu() {
1260 NOTIMPLEMENTED(); 1295 NOTIMPLEMENTED();
1261 } 1296 }
1262 #endif 1297 #endif
1263 1298
1264 } // namespace content 1299 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698