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

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

Issue 2475443003: Drag-and-drop: Move startDrag out of WebView/RenderView. (Closed)
Patch Set: 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 bool ChromeClientImpl::hadFormInteraction() const { 253 bool ChromeClientImpl::hadFormInteraction() const {
254 return m_webView->pageImportanceSignals() && 254 return m_webView->pageImportanceSignals() &&
255 m_webView->pageImportanceSignals()->hadFormInteraction(); 255 m_webView->pageImportanceSignals()->hadFormInteraction();
256 } 256 }
257 257
258 void ChromeClientImpl::startDragging(LocalFrame* frame, 258 void ChromeClientImpl::startDragging(LocalFrame* frame,
259 const WebDragData& dragData, 259 const WebDragData& dragData,
260 WebDragOperationsMask mask, 260 WebDragOperationsMask mask,
261 const WebImage& dragImage, 261 const WebImage& dragImage,
262 const WebPoint& dragImageOffset) { 262 const WebPoint& dragImageOffset) {
263 m_webView->startDragging(frame, dragData, mask, dragImage, dragImageOffset); 263 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame);
264 if (!webFrame->localRoot()->frameWidget() ||
265 !webFrame->localRoot()->frameWidget()->client()) {
266 return;
267 }
268 m_webView->m_doingDragAndDrop = true;
269 webFrame->localRoot()->frameWidget()->client()->startDragging(
270 webFrame, dragData, mask, dragImage, dragImageOffset);
264 } 271 }
265 272
266 bool ChromeClientImpl::acceptsLoadDrops() const { 273 bool ChromeClientImpl::acceptsLoadDrops() const {
267 return !m_webView->client() || m_webView->client()->acceptsLoadDrops(); 274 return !m_webView->client() || m_webView->client()->acceptsLoadDrops();
268 } 275 }
269 276
270 namespace { 277 namespace {
271 278
272 void updatePolicyForEvent(const WebInputEvent* inputEvent, 279 void updatePolicyForEvent(const WebInputEvent* inputEvent,
273 NavigationPolicy* policy) { 280 NavigationPolicy* policy) {
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 if (RuntimeEnabledFeatures::presentationEnabled()) 1162 if (RuntimeEnabledFeatures::presentationEnabled())
1156 PresentationController::provideTo(frame, client->presentationClient()); 1163 PresentationController::provideTo(frame, client->presentationClient());
1157 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) 1164 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
1158 provideAudioOutputDeviceClientTo(frame, 1165 provideAudioOutputDeviceClientTo(frame,
1159 AudioOutputDeviceClientImpl::create()); 1166 AudioOutputDeviceClientImpl::create());
1160 if (RuntimeEnabledFeatures::installedAppEnabled()) 1167 if (RuntimeEnabledFeatures::installedAppEnabled())
1161 InstalledAppController::provideTo(frame, client->installedAppClient()); 1168 InstalledAppController::provideTo(frame, client->installedAppClient());
1162 } 1169 }
1163 1170
1164 } // namespace blink 1171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698