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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 292113008: Plumbing for browser process to access text surrounding selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@adb_install_humans
Patch Set: Created 6 years, 6 months 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 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 OnDidAccessInitialDocument) 314 OnDidAccessInitialDocument)
315 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) 315 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener)
316 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) 316 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle)
317 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) 317 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding)
318 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, 318 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission,
319 OnRequestDesktopNotificationPermission) 319 OnRequestDesktopNotificationPermission)
320 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, 320 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show,
321 OnShowDesktopNotification) 321 OnShowDesktopNotification)
322 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel, 322 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel,
323 OnCancelDesktopNotification) 323 OnCancelDesktopNotification)
324 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse,
325 OnTextSurroundingSelectionResponse)
324 IPC_END_MESSAGE_MAP() 326 IPC_END_MESSAGE_MAP()
325 327
326 return handled; 328 return handled;
327 } 329 }
328 330
329 void RenderFrameHostImpl::Init() { 331 void RenderFrameHostImpl::Init() {
330 GetProcess()->ResumeRequestsForView(routing_id_); 332 GetProcess()->ResumeRequestsForView(routing_id_);
331 } 333 }
332 334
333 void RenderFrameHostImpl::OnAddMessageToConsole( 335 void RenderFrameHostImpl::OnAddMessageToConsole(
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 693
692 void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) { 694 void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) {
693 if (!cancel_notification_callbacks_.count(notification_id)) { 695 if (!cancel_notification_callbacks_.count(notification_id)) {
694 NOTREACHED(); 696 NOTREACHED();
695 return; 697 return;
696 } 698 }
697 cancel_notification_callbacks_[notification_id].Run(); 699 cancel_notification_callbacks_[notification_id].Run();
698 cancel_notification_callbacks_.erase(notification_id); 700 cancel_notification_callbacks_.erase(notification_id);
699 } 701 }
700 702
703 void RenderFrameHostImpl::OnTextSurroundingSelectionResponse(
704 const base::string16& content,
705 size_t start_offset,
706 size_t end_offset) {
707 render_view_host_->OnTextSurroundingSelectionResponse(
708 content, start_offset, end_offset);
709 }
710
701 void RenderFrameHostImpl::OnDidAccessInitialDocument() { 711 void RenderFrameHostImpl::OnDidAccessInitialDocument() {
702 delegate_->DidAccessInitialDocument(); 712 delegate_->DidAccessInitialDocument();
703 } 713 }
704 714
705 void RenderFrameHostImpl::OnDidDisownOpener() { 715 void RenderFrameHostImpl::OnDidDisownOpener() {
706 // This message is only sent for top-level frames. TODO(avi): when frame tree 716 // This message is only sent for top-level frames. TODO(avi): when frame tree
707 // mirroring works correctly, add a check here to enforce it. 717 // mirroring works correctly, add a check here to enforce it.
708 delegate_->DidDisownOpener(this); 718 delegate_->DidDisownOpener(this);
709 } 719 }
710 720
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 cancel_notification_callbacks_.erase(notification_id); 900 cancel_notification_callbacks_.erase(notification_id);
891 } 901 }
892 902
893 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( 903 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone(
894 int callback_context) { 904 int callback_context) {
895 Send(new DesktopNotificationMsg_PermissionRequestDone( 905 Send(new DesktopNotificationMsg_PermissionRequestDone(
896 routing_id_, callback_context)); 906 routing_id_, callback_context));
897 } 907 }
898 908
899 } // namespace content 909 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698