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

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

Issue 2568893002: Prevent drag-and-drop events from firing over cross-site, same-page frames. (Closed)
Patch Set: Fixed typo in comment. 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 web_input_event_modifiers |= blink::WebInputEvent::MetaKey; 395 web_input_event_modifiers |= blink::WebInputEvent::MetaKey;
394 if (aura_event_flags & ui::EF_LEFT_MOUSE_BUTTON) 396 if (aura_event_flags & ui::EF_LEFT_MOUSE_BUTTON)
395 web_input_event_modifiers |= blink::WebInputEvent::LeftButtonDown; 397 web_input_event_modifiers |= blink::WebInputEvent::LeftButtonDown;
396 if (aura_event_flags & ui::EF_MIDDLE_MOUSE_BUTTON) 398 if (aura_event_flags & ui::EF_MIDDLE_MOUSE_BUTTON)
397 web_input_event_modifiers |= blink::WebInputEvent::MiddleButtonDown; 399 web_input_event_modifiers |= blink::WebInputEvent::MiddleButtonDown;
398 if (aura_event_flags & ui::EF_RIGHT_MOUSE_BUTTON) 400 if (aura_event_flags & ui::EF_RIGHT_MOUSE_BUTTON)
399 web_input_event_modifiers |= blink::WebInputEvent::RightButtonDown; 401 web_input_event_modifiers |= blink::WebInputEvent::RightButtonDown;
400 return web_input_event_modifiers; 402 return web_input_event_modifiers;
401 } 403 }
402 404
405 GlobalRoutingID GetRenderViewHostID(RenderViewHost* rvh) {
406 return GlobalRoutingID(rvh->GetProcess()->GetID(), rvh->GetRoutingID());
407 }
408
403 } // namespace 409 } // namespace
404 410
405 class WebContentsViewAura::WindowObserver 411 class WebContentsViewAura::WindowObserver
406 : public aura::WindowObserver, public aura::WindowTreeHostObserver { 412 : public aura::WindowObserver, public aura::WindowTreeHostObserver {
407 public: 413 public:
408 explicit WindowObserver(WebContentsViewAura* view) 414 explicit WindowObserver(WebContentsViewAura* view)
409 : view_(view), 415 : view_(view),
410 host_window_(NULL) { 416 host_window_(NULL) {
411 view_->window_->AddObserver(this); 417 view_->window_->AddObserver(this);
412 } 418 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 514
509 //////////////////////////////////////////////////////////////////////////////// 515 ////////////////////////////////////////////////////////////////////////////////
510 // WebContentsViewAura, public: 516 // WebContentsViewAura, public:
511 517
512 WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents, 518 WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents,
513 WebContentsViewDelegate* delegate) 519 WebContentsViewDelegate* delegate)
514 : web_contents_(web_contents), 520 : web_contents_(web_contents),
515 delegate_(delegate), 521 delegate_(delegate),
516 current_drag_op_(blink::WebDragOperationNone), 522 current_drag_op_(blink::WebDragOperationNone),
517 drag_dest_delegate_(nullptr), 523 drag_dest_delegate_(nullptr),
518 current_rvh_for_drag_(nullptr), 524 current_rvh_for_drag_(ChildProcessHost::kInvalidUniqueID,
525 MSG_ROUTING_NONE),
526 drag_start_process_id_(ChildProcessHost::kInvalidUniqueID),
527 drag_start_view_id_(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE),
519 current_overscroll_gesture_(OVERSCROLL_NONE), 528 current_overscroll_gesture_(OVERSCROLL_NONE),
520 completed_overscroll_gesture_(OVERSCROLL_NONE), 529 completed_overscroll_gesture_(OVERSCROLL_NONE),
521 navigation_overlay_(nullptr), 530 navigation_overlay_(nullptr),
522 init_rwhv_with_null_parent_for_testing_(false) {} 531 init_rwhv_with_null_parent_for_testing_(false) {}
523 532
524 void WebContentsViewAura::SetDelegateForTesting( 533 void WebContentsViewAura::SetDelegateForTesting(
525 WebContentsViewDelegate* delegate) { 534 WebContentsViewDelegate* delegate) {
526 delegate_.reset(delegate); 535 delegate_.reset(delegate);
527 } 536 }
528 537
(...skipping 16 matching lines...) Expand all
545 if (web_contents_->GetInterstitialPage()) 554 if (web_contents_->GetInterstitialPage())
546 web_contents_->GetInterstitialPage()->SetSize(size); 555 web_contents_->GetInterstitialPage()->SetSize(size);
547 RenderWidgetHostView* rwhv = 556 RenderWidgetHostView* rwhv =
548 web_contents_->GetRenderWidgetHostView(); 557 web_contents_->GetRenderWidgetHostView();
549 if (rwhv) 558 if (rwhv)
550 rwhv->SetSize(size); 559 rwhv->SetSize(size);
551 } 560 }
552 561
553 void WebContentsViewAura::EndDrag(RenderWidgetHost* source_rwh, 562 void WebContentsViewAura::EndDrag(RenderWidgetHost* source_rwh,
554 blink::WebDragOperationsMask ops) { 563 blink::WebDragOperationsMask ops) {
564 drag_start_process_id_ = ChildProcessHost::kInvalidUniqueID;
565 drag_start_view_id_ = GlobalRoutingID(ChildProcessHost::kInvalidUniqueID,
566 MSG_ROUTING_NONE);
567
555 if (!web_contents_) 568 if (!web_contents_)
556 return; 569 return;
557 570
558 aura::Window* window = GetContentNativeView(); 571 aura::Window* window = GetContentNativeView();
559 gfx::Point screen_loc = display::Screen::GetScreen()->GetCursorScreenPoint(); 572 gfx::Point screen_loc = display::Screen::GetScreen()->GetCursorScreenPoint();
560 gfx::Point client_loc = screen_loc; 573 gfx::Point client_loc = screen_loc;
561 aura::client::ScreenPositionClient* screen_position_client = 574 aura::client::ScreenPositionClient* screen_position_client =
562 aura::client::GetScreenPositionClient(window->GetRootWindow()); 575 aura::client::GetScreenPositionClient(window->GetRootWindow());
563 if (screen_position_client) 576 if (screen_position_client)
564 screen_position_client->ConvertPointFromScreen(window, &client_loc); 577 screen_position_client->ConvertPointFromScreen(window, &client_loc);
565 578
566 // TODO(paulmeyer): In the OOPIF case, should |client_loc| be converted to 579 // TODO(paulmeyer): In the OOPIF case, should |client_loc| be converted to the
567 // the coordinates local to |drag_start_rwh_|? See crbug.com/647249. 580 // coordinates local to |source_rwh|? See crbug.com/647249.
568 web_contents_->DragSourceEndedAt(client_loc.x(), client_loc.y(), 581 web_contents_->DragSourceEndedAt(client_loc.x(), client_loc.y(),
569 screen_loc.x(), screen_loc.y(), ops, 582 screen_loc.x(), screen_loc.y(), ops,
570 source_rwh); 583 source_rwh);
571 584
572 web_contents_->SystemDragEnded(source_rwh); 585 web_contents_->SystemDragEnded(source_rwh);
573 } 586 }
574 587
575 void WebContentsViewAura::InstallOverscrollControllerDelegate( 588 void WebContentsViewAura::InstallOverscrollControllerDelegate(
576 RenderWidgetHostViewAura* view) { 589 RenderWidgetHostViewAura* view) {
577 const std::string value = base::CommandLine::ForCurrentProcess()-> 590 const std::string value = base::CommandLine::ForCurrentProcess()->
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView()); 635 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView());
623 return view ? view->selection_controller_client() : nullptr; 636 return view ? view->selection_controller_client() : nullptr;
624 } 637 }
625 638
626 gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const { 639 gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
627 if (init_rwhv_with_null_parent_for_testing_) 640 if (init_rwhv_with_null_parent_for_testing_)
628 return nullptr; 641 return nullptr;
629 return window_.get(); 642 return window_.get();
630 } 643 }
631 644
645 bool WebContentsViewAura::IsValidDragTarget(
646 RenderWidgetHostImpl* target_rwh) const {
647 return target_rwh->GetProcess()->GetID() == drag_start_process_id_ ||
648 GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
649 drag_start_view_id_;
650 }
651
632 //////////////////////////////////////////////////////////////////////////////// 652 ////////////////////////////////////////////////////////////////////////////////
633 // WebContentsViewAura, WebContentsView implementation: 653 // WebContentsViewAura, WebContentsView implementation:
634 654
635 gfx::NativeView WebContentsViewAura::GetNativeView() const { 655 gfx::NativeView WebContentsViewAura::GetNativeView() const {
636 return window_.get(); 656 return window_.get();
637 } 657 }
638 658
639 gfx::NativeView WebContentsViewAura::GetContentNativeView() const { 659 gfx::NativeView WebContentsViewAura::GetContentNativeView() const {
640 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); 660 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView();
641 return rwhv ? rwhv->GetNativeView() : NULL; 661 return rwhv ? rwhv->GetNativeView() : NULL;
(...skipping 258 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