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

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

Issue 2485693003: Drag-and-drop: DragEnter, DragOver, DragLeave, DragDrop (Closed)
Patch Set: Rebased. More fixes. 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "content/common/input_messages.h" 53 #include "content/common/input_messages.h"
54 #include "content/common/page_messages.h" 54 #include "content/common/page_messages.h"
55 #include "content/common/render_message_filter.mojom.h" 55 #include "content/common/render_message_filter.mojom.h"
56 #include "content/common/site_isolation_policy.h" 56 #include "content/common/site_isolation_policy.h"
57 #include "content/common/view_messages.h" 57 #include "content/common/view_messages.h"
58 #include "content/public/common/bindings_policy.h" 58 #include "content/public/common/bindings_policy.h"
59 #include "content/public/common/browser_side_navigation_policy.h" 59 #include "content/public/common/browser_side_navigation_policy.h"
60 #include "content/public/common/content_client.h" 60 #include "content/public/common/content_client.h"
61 #include "content/public/common/content_constants.h" 61 #include "content/public/common/content_constants.h"
62 #include "content/public/common/content_switches.h" 62 #include "content/public/common/content_switches.h"
63 #include "content/public/common/drop_data.h"
64 #include "content/public/common/favicon_url.h" 63 #include "content/public/common/favicon_url.h"
65 #include "content/public/common/page_importance_signals.h" 64 #include "content/public/common/page_importance_signals.h"
66 #include "content/public/common/page_state.h" 65 #include "content/public/common/page_state.h"
67 #include "content/public/common/page_zoom.h" 66 #include "content/public/common/page_zoom.h"
68 #include "content/public/common/three_d_api_types.h" 67 #include "content/public/common/three_d_api_types.h"
69 #include "content/public/common/url_constants.h" 68 #include "content/public/common/url_constants.h"
70 #include "content/public/common/web_preferences.h" 69 #include "content/public/common/web_preferences.h"
71 #include "content/public/renderer/content_renderer_client.h" 70 #include "content/public/renderer/content_renderer_client.h"
72 #include "content/public/renderer/document_state.h" 71 #include "content/public/renderer/document_state.h"
73 #include "content/public/renderer/navigation_state.h" 72 #include "content/public/renderer/navigation_state.h"
(...skipping 30 matching lines...) Expand all
104 #include "media/renderers/gpu_video_accelerator_factories.h" 103 #include "media/renderers/gpu_video_accelerator_factories.h"
105 #include "net/base/data_url.h" 104 #include "net/base/data_url.h"
106 #include "net/base/escape.h" 105 #include "net/base/escape.h"
107 #include "net/base/net_errors.h" 106 #include "net/base/net_errors.h"
108 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 107 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
109 #include "net/http/http_util.h" 108 #include "net/http/http_util.h"
110 #include "skia/ext/platform_canvas.h" 109 #include "skia/ext/platform_canvas.h"
111 #include "third_party/WebKit/public/platform/FilePathConversion.h" 110 #include "third_party/WebKit/public/platform/FilePathConversion.h"
112 #include "third_party/WebKit/public/platform/URLConversion.h" 111 #include "third_party/WebKit/public/platform/URLConversion.h"
113 #include "third_party/WebKit/public/platform/WebConnectionType.h" 112 #include "third_party/WebKit/public/platform/WebConnectionType.h"
114 #include "third_party/WebKit/public/platform/WebDragData.h"
115 #include "third_party/WebKit/public/platform/WebHTTPBody.h" 113 #include "third_party/WebKit/public/platform/WebHTTPBody.h"
116 #include "third_party/WebKit/public/platform/WebImage.h" 114 #include "third_party/WebKit/public/platform/WebImage.h"
117 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" 115 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
118 #include "third_party/WebKit/public/platform/WebPoint.h" 116 #include "third_party/WebKit/public/platform/WebPoint.h"
119 #include "third_party/WebKit/public/platform/WebRect.h" 117 #include "third_party/WebKit/public/platform/WebRect.h"
120 #include "third_party/WebKit/public/platform/WebSize.h" 118 #include "third_party/WebKit/public/platform/WebSize.h"
121 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" 119 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h"
122 #include "third_party/WebKit/public/platform/WebString.h" 120 #include "third_party/WebKit/public/platform/WebString.h"
123 #include "third_party/WebKit/public/platform/WebURL.h" 121 #include "third_party/WebKit/public/platform/WebURL.h"
124 #include "third_party/WebKit/public/platform/WebURLError.h" 122 #include "third_party/WebKit/public/platform/WebURLError.h"
(...skipping 30 matching lines...) Expand all
155 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 153 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
156 #include "third_party/WebKit/public/web/WebScriptSource.h" 154 #include "third_party/WebKit/public/web/WebScriptSource.h"
157 #include "third_party/WebKit/public/web/WebSearchableFormData.h" 155 #include "third_party/WebKit/public/web/WebSearchableFormData.h"
158 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 156 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
159 #include "third_party/WebKit/public/web/WebSettings.h" 157 #include "third_party/WebKit/public/web/WebSettings.h"
160 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" 158 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
161 #include "third_party/WebKit/public/web/WebView.h" 159 #include "third_party/WebKit/public/web/WebView.h"
162 #include "third_party/WebKit/public/web/WebWindowFeatures.h" 160 #include "third_party/WebKit/public/web/WebWindowFeatures.h"
163 #include "third_party/icu/source/common/unicode/uchar.h" 161 #include "third_party/icu/source/common/unicode/uchar.h"
164 #include "third_party/icu/source/common/unicode/uscript.h" 162 #include "third_party/icu/source/common/unicode/uscript.h"
165 #include "ui/base/clipboard/clipboard.h"
166 #include "ui/base/ui_base_switches_util.h" 163 #include "ui/base/ui_base_switches_util.h"
167 #include "ui/events/latency_info.h" 164 #include "ui/events/latency_info.h"
168 #include "ui/gfx/geometry/point.h" 165 #include "ui/gfx/geometry/point.h"
169 #include "ui/gfx/geometry/rect.h" 166 #include "ui/gfx/geometry/rect.h"
170 #include "ui/gfx/geometry/rect_conversions.h" 167 #include "ui/gfx/geometry/rect_conversions.h"
171 #include "ui/gfx/geometry/size_conversions.h" 168 #include "ui/gfx/geometry/size_conversions.h"
172 #include "ui/gfx/native_widget_types.h" 169 #include "ui/gfx/native_widget_types.h"
173 #include "url/origin.h" 170 #include "url/origin.h"
174 #include "url/url_constants.h" 171 #include "url/url_constants.h"
175 #include "v8/include/v8.h" 172 #include "v8/include/v8.h"
(...skipping 24 matching lines...) Expand all
200 #endif 197 #endif
201 198
202 using blink::WebAXObject; 199 using blink::WebAXObject;
203 using blink::WebApplicationCacheHost; 200 using blink::WebApplicationCacheHost;
204 using blink::WebApplicationCacheHostClient; 201 using blink::WebApplicationCacheHostClient;
205 using blink::WebColor; 202 using blink::WebColor;
206 using blink::WebConsoleMessage; 203 using blink::WebConsoleMessage;
207 using blink::WebData; 204 using blink::WebData;
208 using blink::WebDataSource; 205 using blink::WebDataSource;
209 using blink::WebDocument; 206 using blink::WebDocument;
210 using blink::WebDragData;
211 using blink::WebDragOperation; 207 using blink::WebDragOperation;
212 using blink::WebDragOperationsMask;
213 using blink::WebElement; 208 using blink::WebElement;
214 using blink::WebFileChooserCompletion; 209 using blink::WebFileChooserCompletion;
215 using blink::WebFormControlElement; 210 using blink::WebFormControlElement;
216 using blink::WebFormElement; 211 using blink::WebFormElement;
217 using blink::WebFrame; 212 using blink::WebFrame;
218 using blink::WebFrameContentDumper; 213 using blink::WebFrameContentDumper;
219 using blink::WebGestureEvent; 214 using blink::WebGestureEvent;
220 using blink::WebHistoryItem; 215 using blink::WebHistoryItem;
221 using blink::WebHTTPBody; 216 using blink::WebHTTPBody;
222 using blink::WebHitTestResult; 217 using blink::WebHitTestResult;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 DCHECK(sizes->empty()); 367 DCHECK(sizes->empty());
373 sizes->reserve(web_sizes.size()); 368 sizes->reserve(web_sizes.size());
374 for (size_t i = 0; i < web_sizes.size(); ++i) 369 for (size_t i = 0; i < web_sizes.size(); ++i)
375 sizes->push_back(gfx::Size(web_sizes[i])); 370 sizes->push_back(gfx::Size(web_sizes[i]));
376 } 371 }
377 372
378 /////////////////////////////////////////////////////////////////////////////// 373 ///////////////////////////////////////////////////////////////////////////////
379 374
380 namespace { 375 namespace {
381 376
382 WebDragData DropMetaDataToWebDragData(
383 const std::vector<DropData::Metadata>& drop_meta_data) {
384 std::vector<WebDragData::Item> item_list;
385 for (const auto& meta_data_item : drop_meta_data) {
386 if (meta_data_item.kind == DropData::Kind::STRING) {
387 WebDragData::Item item;
388 item.storageType = WebDragData::Item::StorageTypeString;
389 item.stringType = meta_data_item.mime_type;
390 // Have to pass a dummy URL here instead of an empty URL because the
391 // DropData received by browser_plugins goes through a round trip:
392 // DropData::MetaData --> WebDragData-->DropData. In the end, DropData
393 // will contain an empty URL (which means no URL is dragged) if the URL in
394 // WebDragData is empty.
395 if (base::EqualsASCII(meta_data_item.mime_type,
396 ui::Clipboard::kMimeTypeURIList)) {
397 item.stringData = WebString::fromUTF8("about:dragdrop-placeholder");
398 }
399 item_list.push_back(item);
400 continue;
401 }
402
403 // TODO(hush): crbug.com/584789. Blink needs to support creating a file with
404 // just the mimetype. This is needed to drag files to WebView on Android
405 // platform.
406 if ((meta_data_item.kind == DropData::Kind::FILENAME) &&
407 !meta_data_item.filename.empty()) {
408 WebDragData::Item item;
409 item.storageType = WebDragData::Item::StorageTypeFilename;
410 item.filenameData = meta_data_item.filename.AsUTF16Unsafe();
411 item_list.push_back(item);
412 continue;
413 }
414
415 if (meta_data_item.kind == DropData::Kind::FILESYSTEMFILE) {
416 WebDragData::Item item;
417 item.storageType = WebDragData::Item::StorageTypeFileSystemFile;
418 item.fileSystemURL = meta_data_item.file_system_url;
419 item_list.push_back(item);
420 continue;
421 }
422 }
423
424 WebDragData result;
425 result.initialize();
426 result.setItems(item_list);
427 return result;
428 }
429
430 WebDragData DropDataToWebDragData(const DropData& drop_data) {
431 std::vector<WebDragData::Item> item_list;
432
433 // These fields are currently unused when dragging into WebKit.
434 DCHECK(drop_data.download_metadata.empty());
435 DCHECK(drop_data.file_contents.empty());
436 DCHECK(drop_data.file_description_filename.empty());
437
438 if (!drop_data.text.is_null()) {
439 WebDragData::Item item;
440 item.storageType = WebDragData::Item::StorageTypeString;
441 item.stringType = WebString::fromUTF8(ui::Clipboard::kMimeTypeText);
442 item.stringData = drop_data.text.string();
443 item_list.push_back(item);
444 }
445
446 if (!drop_data.url.is_empty()) {
447 WebDragData::Item item;
448 item.storageType = WebDragData::Item::StorageTypeString;
449 item.stringType = WebString::fromUTF8(ui::Clipboard::kMimeTypeURIList);
450 item.stringData = WebString::fromUTF8(drop_data.url.spec());
451 item.title = drop_data.url_title;
452 item_list.push_back(item);
453 }
454
455 if (!drop_data.html.is_null()) {
456 WebDragData::Item item;
457 item.storageType = WebDragData::Item::StorageTypeString;
458 item.stringType = WebString::fromUTF8(ui::Clipboard::kMimeTypeHTML);
459 item.stringData = drop_data.html.string();
460 item.baseURL = drop_data.html_base_url;
461 item_list.push_back(item);
462 }
463
464 for (std::vector<ui::FileInfo>::const_iterator it =
465 drop_data.filenames.begin();
466 it != drop_data.filenames.end();
467 ++it) {
468 WebDragData::Item item;
469 item.storageType = WebDragData::Item::StorageTypeFilename;
470 item.filenameData = it->path.AsUTF16Unsafe();
471 item.displayNameData = it->display_name.AsUTF16Unsafe();
472 item_list.push_back(item);
473 }
474
475 for (std::vector<DropData::FileSystemFileInfo>::const_iterator it =
476 drop_data.file_system_files.begin();
477 it != drop_data.file_system_files.end();
478 ++it) {
479 WebDragData::Item item;
480 item.storageType = WebDragData::Item::StorageTypeFileSystemFile;
481 item.fileSystemURL = it->url;
482 item.fileSystemFileSize = it->size;
483 item_list.push_back(item);
484 }
485
486 for (std::map<base::string16, base::string16>::const_iterator it =
487 drop_data.custom_data.begin();
488 it != drop_data.custom_data.end();
489 ++it) {
490 WebDragData::Item item;
491 item.storageType = WebDragData::Item::StorageTypeString;
492 item.stringType = it->first;
493 item.stringData = it->second;
494 item_list.push_back(item);
495 }
496
497 WebDragData result;
498 result.initialize();
499 result.setItems(item_list);
500 result.setFilesystemId(drop_data.filesystem_id);
501 return result;
502 }
503
504 typedef void (*SetFontFamilyWrapper)(blink::WebSettings*, 377 typedef void (*SetFontFamilyWrapper)(blink::WebSettings*,
505 const base::string16&, 378 const base::string16&,
506 UScriptCode); 379 UScriptCode);
507 380
508 void SetStandardFontFamilyWrapper(WebSettings* settings, 381 void SetStandardFontFamilyWrapper(WebSettings* settings,
509 const base::string16& font, 382 const base::string16& font,
510 UScriptCode script) { 383 UScriptCode script) {
511 settings->setStandardFontFamily(font, script); 384 settings->setStandardFontFamily(font, script);
512 } 385 }
513 386
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 } 1182 }
1310 1183
1311 bool handled = true; 1184 bool handled = true;
1312 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) 1185 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
1313 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) 1186 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand)
1314 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) 1187 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret)
1315 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, 1188 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect,
1316 OnScrollFocusedEditableNodeIntoRect) 1189 OnScrollFocusedEditableNodeIntoRect)
1317 IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale) 1190 IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale)
1318 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) 1191 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
1319 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter)
1320 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver)
1321 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave)
1322 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop)
1323 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) 1192 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded)
1324 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, 1193 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded,
1325 OnDragSourceSystemDragEnded) 1194 OnDragSourceSystemDragEnded)
1326 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings) 1195 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings)
1327 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus) 1196 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
1328 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck) 1197 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
1329 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences) 1198 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
1330 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse, 1199 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse,
1331 OnEnumerateDirectoryResponse) 1200 OnEnumerateDirectoryResponse)
1332 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) 1201 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
2078 const blink::WebElement& element) { 1947 const blink::WebElement& element) {
2079 blink::WebRect bounding_box_in_window = element.boundsInViewport(); 1948 blink::WebRect bounding_box_in_window = element.boundsInViewport();
2080 ConvertViewportToWindowViaWidget(&bounding_box_in_window); 1949 ConvertViewportToWindowViaWidget(&bounding_box_in_window);
2081 return gfx::RectF(bounding_box_in_window); 1950 return gfx::RectF(bounding_box_in_window);
2082 } 1951 }
2083 1952
2084 bool RenderViewImpl::HasAddedInputHandler() const { 1953 bool RenderViewImpl::HasAddedInputHandler() const {
2085 return has_added_input_handler_; 1954 return has_added_input_handler_;
2086 } 1955 }
2087 1956
2088 gfx::Point RenderViewImpl::ConvertWindowPointToViewport(
2089 const gfx::Point& point) {
2090 blink::WebFloatRect point_in_viewport(point.x(), point.y(), 0, 0);
2091 convertWindowToViewport(&point_in_viewport);
2092 return gfx::Point(point_in_viewport.x, point_in_viewport.y);
2093 }
2094
2095 void RenderViewImpl::didChangeIcon(WebLocalFrame* frame, 1957 void RenderViewImpl::didChangeIcon(WebLocalFrame* frame,
2096 WebIconURL::Type icon_type) { 1958 WebIconURL::Type icon_type) {
2097 if (frame->parent()) 1959 if (frame->parent())
2098 return; 1960 return;
2099 1961
2100 WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type); 1962 WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type);
2101 std::vector<FaviconURL> urls; 1963 std::vector<FaviconURL> urls;
2102 for (size_t i = 0; i < icon_urls.size(); i++) { 1964 for (size_t i = 0; i < icon_urls.size(); i++) {
2103 std::vector<gfx::Size> sizes; 1965 std::vector<gfx::Size> sizes;
2104 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 1966 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 2113
2252 enabled_bindings_ |= enabled_bindings_flags; 2114 enabled_bindings_ |= enabled_bindings_flags;
2253 2115
2254 // Keep track of the total bindings accumulated in this process. 2116 // Keep track of the total bindings accumulated in this process.
2255 RenderProcess::current()->AddBindings(enabled_bindings_flags); 2117 RenderProcess::current()->AddBindings(enabled_bindings_flags);
2256 2118
2257 if (main_render_frame_) 2119 if (main_render_frame_)
2258 main_render_frame_->MaybeEnableMojoBindings(); 2120 main_render_frame_->MaybeEnableMojoBindings();
2259 } 2121 }
2260 2122
2261 void RenderViewImpl::OnDragTargetDragEnter(
2262 const std::vector<DropData::Metadata>& drop_meta_data,
2263 const gfx::Point& client_point,
2264 const gfx::Point& screen_point,
2265 WebDragOperationsMask ops,
2266 int key_modifiers) {
2267 WebDragOperation operation = webview()->dragTargetDragEnter(
2268 DropMetaDataToWebDragData(drop_meta_data), client_point, screen_point,
2269 ops, key_modifiers);
2270
2271 Send(new DragHostMsg_UpdateDragCursor(GetRoutingID(), operation));
2272 }
2273
2274 void RenderViewImpl::OnDragTargetDragOver(const gfx::Point& client_point,
2275 const gfx::Point& screen_point,
2276 WebDragOperationsMask ops,
2277 int key_modifiers) {
2278 WebDragOperation operation = webview()->dragTargetDragOver(
2279 ConvertWindowPointToViewport(client_point),
2280 screen_point,
2281 ops,
2282 key_modifiers);
2283
2284 Send(new DragHostMsg_UpdateDragCursor(GetRoutingID(), operation));
2285 }
2286
2287 void RenderViewImpl::OnDragTargetDragLeave() {
2288 webview()->dragTargetDragLeave();
2289 }
2290
2291 void RenderViewImpl::OnDragTargetDrop(const DropData& drop_data,
2292 const gfx::Point& client_point,
2293 const gfx::Point& screen_point,
2294 int key_modifiers) {
2295 webview()->dragTargetDrop(DropDataToWebDragData(drop_data),
2296 ConvertWindowPointToViewport(client_point),
2297 screen_point, key_modifiers);
2298 }
2299
2300 void RenderViewImpl::OnDragSourceEnded(const gfx::Point& client_point, 2123 void RenderViewImpl::OnDragSourceEnded(const gfx::Point& client_point,
2301 const gfx::Point& screen_point, 2124 const gfx::Point& screen_point,
2302 WebDragOperation op) { 2125 WebDragOperation op) {
2303 webview()->dragSourceEndedAt( 2126 webview()->dragSourceEndedAt(
2304 ConvertWindowPointToViewport(client_point), screen_point, op); 2127 ConvertWindowPointToViewport(client_point), screen_point, op);
2305 } 2128 }
2306 2129
2307 void RenderViewImpl::OnDragSourceSystemDragEnded() { 2130 void RenderViewImpl::OnDragSourceSystemDragEnded() {
2308 webview()->dragSourceSystemDragEnded(); 2131 webview()->dragSourceSystemDragEnded();
2309 } 2132 }
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
2970 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 2793 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
2971 } 2794 }
2972 2795
2973 std::unique_ptr<InputEventAck> ack( 2796 std::unique_ptr<InputEventAck> ack(
2974 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, 2797 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type,
2975 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); 2798 INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
2976 OnInputEventAck(std::move(ack)); 2799 OnInputEventAck(std::move(ack));
2977 } 2800 }
2978 2801
2979 } // namespace content 2802 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698