Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 505 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, | 506 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, |
| 506 OnSetNeedsBeginFrames) | 507 OnSetNeedsBeginFrames) |
| 507 IPC_MESSAGE_UNHANDLED(handled = false) | 508 IPC_MESSAGE_UNHANDLED(handled = false) |
| 508 IPC_END_MESSAGE_MAP() | 509 IPC_END_MESSAGE_MAP() |
| 509 return handled; | 510 return handled; |
| 510 } | 511 } |
| 511 | 512 |
| 512 if (owner_delegate_ && owner_delegate_->OnMessageReceived(msg)) | 513 if (owner_delegate_ && owner_delegate_->OnMessageReceived(msg)) |
| 513 return true; | 514 return true; |
| 514 | 515 |
| 516 if (delegate_ && delegate_->OnMessageReceived(this, msg)) | |
| 517 return true; | |
| 518 | |
| 515 bool handled = true; | 519 bool handled = true; |
| 516 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostImpl, msg) | 520 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostImpl, msg) |
| 517 IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone) | 521 IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone) |
| 518 IPC_MESSAGE_HANDLER(FrameHostMsg_HittestData, OnHittestData) | 522 IPC_MESSAGE_HANDLER(FrameHostMsg_HittestData, OnHittestData) |
| 519 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, | 523 IPC_MESSAGE_HANDLER(InputHostMsg_QueueSyntheticGesture, |
| 520 OnQueueSyntheticGesture) | 524 OnQueueSyntheticGesture) |
| 521 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, | 525 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, |
| 522 OnImeCancelComposition) | 526 OnImeCancelComposition) |
| 523 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 527 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
| 524 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, | 528 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 538 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, | 542 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, |
| 539 OnSelectionBoundsChanged) | 543 OnSelectionBoundsChanged) |
| 540 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCompositionRangeChanged, | 544 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCompositionRangeChanged, |
| 541 OnImeCompositionRangeChanged) | 545 OnImeCompositionRangeChanged) |
| 542 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad, | 546 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad, |
| 543 OnFirstPaintAfterLoad) | 547 OnFirstPaintAfterLoad) |
| 544 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardCompositorProto, | 548 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardCompositorProto, |
| 545 OnForwardCompositorProto) | 549 OnForwardCompositorProto) |
| 546 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, OnSetNeedsBeginFrames) | 550 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, OnSetNeedsBeginFrames) |
| 547 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) | 551 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) |
| 552 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | |
|
ncarter (slow)
2016/11/14 20:23:45
Seems like this message is actually handled by a W
| |
| 548 IPC_MESSAGE_UNHANDLED(handled = false) | 553 IPC_MESSAGE_UNHANDLED(handled = false) |
| 549 IPC_END_MESSAGE_MAP() | 554 IPC_END_MESSAGE_MAP() |
| 550 | 555 |
| 551 if (!handled && input_router_ && input_router_->OnMessageReceived(msg)) | 556 if (!handled && input_router_ && input_router_->OnMessageReceived(msg)) |
| 552 return true; | 557 return true; |
| 553 | 558 |
| 554 if (!handled && view_ && view_->OnMessageReceived(msg)) | 559 if (!handled && view_ && view_->OnMessageReceived(msg)) |
| 555 return true; | 560 return true; |
| 556 | 561 |
| 557 return handled; | 562 return handled; |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1507 if (policy->CanReadFileSystemFile(GetProcess()->GetID(), file_system_url)) | 1512 if (policy->CanReadFileSystemFile(GetProcess()->GetID(), file_system_url)) |
| 1508 filtered_data.file_system_files.push_back(drop_data.file_system_files[i]); | 1513 filtered_data.file_system_files.push_back(drop_data.file_system_files[i]); |
| 1509 } | 1514 } |
| 1510 | 1515 |
| 1511 float scale = GetScaleFactorForView(GetView()); | 1516 float scale = GetScaleFactorForView(GetView()); |
| 1512 gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, scale)); | 1517 gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, scale)); |
| 1513 view->StartDragging(filtered_data, drag_operations_mask, image, | 1518 view->StartDragging(filtered_data, drag_operations_mask, image, |
| 1514 bitmap_offset_in_dip, event_info); | 1519 bitmap_offset_in_dip, event_info); |
| 1515 } | 1520 } |
| 1516 | 1521 |
| 1522 void RenderWidgetHostImpl::OnUpdateDragCursor(WebDragOperation current_op) { | |
| 1523 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); | |
| 1524 if (view) | |
| 1525 view->UpdateDragCursor(current_op); | |
| 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 Loading... | |
| 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 |
| OLD | NEW |