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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2503563002: Drag-and-drop: updateDragCursor (Closed)
Patch Set: Addressed comments by nick@. 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 // 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/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <tuple> 10 #include <tuple>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 #include "ui/snapshot/snapshot.h" 93 #include "ui/snapshot/snapshot.h"
94 94
95 #if defined(OS_MACOSX) 95 #if defined(OS_MACOSX)
96 #include "device/power_save_blocker/power_save_blocker.h" 96 #include "device/power_save_blocker/power_save_blocker.h"
97 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" 97 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
98 #endif 98 #endif
99 99
100 using base::Time; 100 using base::Time;
101 using base::TimeDelta; 101 using base::TimeDelta;
102 using base::TimeTicks; 102 using base::TimeTicks;
103 using blink::WebDragOperation;
103 using blink::WebDragOperationsMask; 104 using blink::WebDragOperationsMask;
104 using blink::WebGestureEvent; 105 using blink::WebGestureEvent;
105 using blink::WebInputEvent; 106 using blink::WebInputEvent;
106 using blink::WebKeyboardEvent; 107 using blink::WebKeyboardEvent;
107 using blink::WebMouseEvent; 108 using blink::WebMouseEvent;
108 using blink::WebMouseWheelEvent; 109 using blink::WebMouseWheelEvent;
109 using blink::WebTextDirection; 110 using blink::WebTextDirection;
110 111
111 namespace content { 112 namespace content {
112 namespace { 113 namespace {
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, 539 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged,
539 OnSelectionBoundsChanged) 540 OnSelectionBoundsChanged)
540 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCompositionRangeChanged, 541 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCompositionRangeChanged,
541 OnImeCompositionRangeChanged) 542 OnImeCompositionRangeChanged)
542 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad, 543 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad,
543 OnFirstPaintAfterLoad) 544 OnFirstPaintAfterLoad)
544 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardCompositorProto, 545 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardCompositorProto,
545 OnForwardCompositorProto) 546 OnForwardCompositorProto)
546 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, OnSetNeedsBeginFrames) 547 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, OnSetNeedsBeginFrames)
547 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) 548 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging)
549 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
548 IPC_MESSAGE_UNHANDLED(handled = false) 550 IPC_MESSAGE_UNHANDLED(handled = false)
549 IPC_END_MESSAGE_MAP() 551 IPC_END_MESSAGE_MAP()
550 552
551 if (!handled && input_router_ && input_router_->OnMessageReceived(msg)) 553 if (!handled && input_router_ && input_router_->OnMessageReceived(msg))
552 return true; 554 return true;
553 555
554 if (!handled && view_ && view_->OnMessageReceived(msg)) 556 if (!handled && view_ && view_->OnMessageReceived(msg))
555 return true; 557 return true;
556 558
557 return handled; 559 return handled;
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 if (policy->CanReadFileSystemFile(GetProcess()->GetID(), file_system_url)) 1509 if (policy->CanReadFileSystemFile(GetProcess()->GetID(), file_system_url))
1508 filtered_data.file_system_files.push_back(drop_data.file_system_files[i]); 1510 filtered_data.file_system_files.push_back(drop_data.file_system_files[i]);
1509 } 1511 }
1510 1512
1511 float scale = GetScaleFactorForView(GetView()); 1513 float scale = GetScaleFactorForView(GetView());
1512 gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, scale)); 1514 gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, scale));
1513 view->StartDragging(filtered_data, drag_operations_mask, image, 1515 view->StartDragging(filtered_data, drag_operations_mask, image,
1514 bitmap_offset_in_dip, event_info); 1516 bitmap_offset_in_dip, event_info);
1515 } 1517 }
1516 1518
1519 void RenderWidgetHostImpl::OnUpdateDragCursor(WebDragOperation current_op) {
1520 if (delegate_ && delegate_->OnUpdateDragCursor())
1521 return;
1522
1523 RenderViewHostDelegateView* view = delegate_->GetDelegateView();
1524 if (view)
1525 view->UpdateDragCursor(current_op);
kenrb 2016/11/16 16:22:15 I have a question about this. Could this be racy i
1526 }
1527
1517 void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status, 1528 void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status,
1518 int exit_code) { 1529 int exit_code) {
1519 if (!renderer_initialized_) 1530 if (!renderer_initialized_)
1520 return; 1531 return;
1521 1532
1522 // Clearing this flag causes us to re-create the renderer when recovering 1533 // Clearing this flag causes us to re-create the renderer when recovering
1523 // from a crashed renderer. 1534 // from a crashed renderer.
1524 renderer_initialized_ = false; 1535 renderer_initialized_ = false;
1525 1536
1526 waiting_for_screen_rects_ack_ = false; 1537 waiting_for_screen_rects_ack_ = false;
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 // Note: We are using the origin URL provided by the sender here. It may be 2476 // Note: We are using the origin URL provided by the sender here. It may be
2466 // different from the receiver's. 2477 // different from the receiver's.
2467 file_system_file.url = 2478 file_system_file.url =
2468 GURL(storage::GetIsolatedFileSystemRootURIString( 2479 GURL(storage::GetIsolatedFileSystemRootURIString(
2469 file_system_url.origin(), filesystem_id, std::string()) 2480 file_system_url.origin(), filesystem_id, std::string())
2470 .append(register_name)); 2481 .append(register_name));
2471 } 2482 }
2472 } 2483 }
2473 2484
2474 } // namespace content 2485 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698