OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/metrics/user_metrics_action.h" | 10 #include "base/metrics/user_metrics_action.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 OnDidAccessInitialDocument) | 313 OnDidAccessInitialDocument) |
314 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) | 314 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) |
315 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) | 315 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) |
316 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) | 316 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) |
317 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, | 317 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, |
318 OnRequestDesktopNotificationPermission) | 318 OnRequestDesktopNotificationPermission) |
319 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, | 319 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, |
320 OnShowDesktopNotification) | 320 OnShowDesktopNotification) |
321 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel, | 321 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel, |
322 OnCancelDesktopNotification) | 322 OnCancelDesktopNotification) |
323 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, | |
324 OnTextSurroundingSelectionResponse) | |
323 IPC_END_MESSAGE_MAP() | 325 IPC_END_MESSAGE_MAP() |
324 | 326 |
325 return handled; | 327 return handled; |
326 } | 328 } |
327 | 329 |
328 void RenderFrameHostImpl::Init() { | 330 void RenderFrameHostImpl::Init() { |
329 GetProcess()->ResumeRequestsForView(routing_id_); | 331 GetProcess()->ResumeRequestsForView(routing_id_); |
330 } | 332 } |
331 | 333 |
332 void RenderFrameHostImpl::OnAddMessageToConsole( | 334 void RenderFrameHostImpl::OnAddMessageToConsole( |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
686 | 688 |
687 void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) { | 689 void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) { |
688 if (!cancel_notification_callbacks_.count(notification_id)) { | 690 if (!cancel_notification_callbacks_.count(notification_id)) { |
689 NOTREACHED(); | 691 NOTREACHED(); |
690 return; | 692 return; |
691 } | 693 } |
692 cancel_notification_callbacks_[notification_id].Run(); | 694 cancel_notification_callbacks_[notification_id].Run(); |
693 cancel_notification_callbacks_.erase(notification_id); | 695 cancel_notification_callbacks_.erase(notification_id); |
694 } | 696 } |
695 | 697 |
698 void RenderFrameHostImpl::OnTextSurroundingSelectionResponse( | |
699 const base::string16& content, | |
700 unsigned start_offset, | |
701 unsigned end_offset) { | |
702 render_view_host_->OnTextSurroundingSelectionResponse( | |
nasko
2014/05/22 18:59:04
It will be better to avoid forwarding new function
| |
703 content, start_offset, end_offset); | |
704 } | |
705 | |
696 void RenderFrameHostImpl::OnDidAccessInitialDocument() { | 706 void RenderFrameHostImpl::OnDidAccessInitialDocument() { |
697 delegate_->DidAccessInitialDocument(); | 707 delegate_->DidAccessInitialDocument(); |
698 } | 708 } |
699 | 709 |
700 void RenderFrameHostImpl::OnDidDisownOpener() { | 710 void RenderFrameHostImpl::OnDidDisownOpener() { |
701 // This message is only sent for top-level frames. TODO(avi): when frame tree | 711 // This message is only sent for top-level frames. TODO(avi): when frame tree |
702 // mirroring works correctly, add a check here to enforce it. | 712 // mirroring works correctly, add a check here to enforce it. |
703 delegate_->DidDisownOpener(this); | 713 delegate_->DidDisownOpener(this); |
704 } | 714 } |
705 | 715 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
885 cancel_notification_callbacks_.erase(notification_id); | 895 cancel_notification_callbacks_.erase(notification_id); |
886 } | 896 } |
887 | 897 |
888 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( | 898 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( |
889 int callback_context) { | 899 int callback_context) { |
890 Send(new DesktopNotificationMsg_PermissionRequestDone( | 900 Send(new DesktopNotificationMsg_PermissionRequestDone( |
891 routing_id_, callback_context)); | 901 routing_id_, callback_context)); |
892 } | 902 } |
893 | 903 |
894 } // namespace content | 904 } // namespace content |
OLD | NEW |