Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 WebFrameWidgetBase* frameWidget = webFrame->localRoot()->frameWidget(); | |
| 265 if (!frameWidget || !frameWidget->client()) | |
|
dcheng
2016/11/07 21:11:00
Nit: do we need to null-check client or widget her
paulmeyer
2016/11/07 22:18:13
Probably not. Removed.
| |
| 266 return; | |
| 267 | |
| 268 WebReferrerPolicy policy = webFrame->document().referrerPolicy(); | |
| 269 m_webView->setDoingDragAndDrop(true); | |
| 270 frameWidget->client()->startDragging(policy, dragData, mask, dragImage, | |
| 271 dragImageOffset); | |
| 264 } | 272 } |
| 265 | 273 |
| 266 bool ChromeClientImpl::acceptsLoadDrops() const { | 274 bool ChromeClientImpl::acceptsLoadDrops() const { |
| 267 return !m_webView->client() || m_webView->client()->acceptsLoadDrops(); | 275 return !m_webView->client() || m_webView->client()->acceptsLoadDrops(); |
| 268 } | 276 } |
| 269 | 277 |
| 270 namespace { | 278 namespace { |
| 271 | 279 |
| 272 void updatePolicyForEvent(const WebInputEvent* inputEvent, | 280 void updatePolicyForEvent(const WebInputEvent* inputEvent, |
| 273 NavigationPolicy* policy) { | 281 NavigationPolicy* policy) { |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1155 if (RuntimeEnabledFeatures::presentationEnabled()) | 1163 if (RuntimeEnabledFeatures::presentationEnabled()) |
| 1156 PresentationController::provideTo(frame, client->presentationClient()); | 1164 PresentationController::provideTo(frame, client->presentationClient()); |
| 1157 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) | 1165 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) |
| 1158 provideAudioOutputDeviceClientTo(frame, | 1166 provideAudioOutputDeviceClientTo(frame, |
| 1159 AudioOutputDeviceClientImpl::create()); | 1167 AudioOutputDeviceClientImpl::create()); |
| 1160 if (RuntimeEnabledFeatures::installedAppEnabled()) | 1168 if (RuntimeEnabledFeatures::installedAppEnabled()) |
| 1161 InstalledAppController::provideTo(frame, client->installedAppClient()); | 1169 InstalledAppController::provideTo(frame, client->installedAppClient()); |
| 1162 } | 1170 } |
| 1163 | 1171 |
| 1164 } // namespace blink | 1172 } // namespace blink |
| OLD | NEW |