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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 2884243003: Add a mojo channel for frame messages. (Closed)
Patch Set: Created 3 years, 7 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 (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/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 last_drag_status_ = drag_status; 883 last_drag_status_ = drag_status;
884 EndSystemDragIfApplicable(); 884 EndSystemDragIfApplicable();
885 } 885 }
886 886
887 void BrowserPluginGuest::OnExecuteEditCommand(int browser_plugin_instance_id, 887 void BrowserPluginGuest::OnExecuteEditCommand(int browser_plugin_instance_id,
888 const std::string& name) { 888 const std::string& name) {
889 RenderFrameHost* focused_frame = web_contents()->GetFocusedFrame(); 889 RenderFrameHost* focused_frame = web_contents()->GetFocusedFrame();
890 if (!focused_frame) 890 if (!focused_frame)
891 return; 891 return;
892 892
893 focused_frame->Send(new InputMsg_ExecuteNoValueEditCommand( 893 focused_frame->GetFrameInputHandler()->ExecuteEditCommand(
894 focused_frame->GetRoutingID(), name)); 894 name, base::Optional<std::string>());
dcheng 2017/05/17 04:49:06 Or just nullopt
dtapuska 2017/05/17 17:08:07 Done.
895 } 895 }
896 896
897 void BrowserPluginGuest::OnImeSetComposition( 897 void BrowserPluginGuest::OnImeSetComposition(
898 int browser_plugin_instance_id, 898 int browser_plugin_instance_id,
899 const BrowserPluginHostMsg_SetComposition_Params& params) { 899 const BrowserPluginHostMsg_SetComposition_Params& params) {
900 Send(new InputMsg_ImeSetComposition( 900 Send(new InputMsg_ImeSetComposition(
901 routing_id(), params.text, params.underlines, params.replacement_range, 901 routing_id(), params.text, params.underlines, params.replacement_range,
902 params.selection_start, params.selection_end)); 902 params.selection_start, params.selection_end));
903 } 903 }
904 904
(...skipping 11 matching lines...) Expand all
916 Send(new InputMsg_ImeFinishComposingText(routing_id(), keep_selection)); 916 Send(new InputMsg_ImeFinishComposingText(routing_id(), keep_selection));
917 } 917 }
918 918
919 void BrowserPluginGuest::OnExtendSelectionAndDelete( 919 void BrowserPluginGuest::OnExtendSelectionAndDelete(
920 int browser_plugin_instance_id, 920 int browser_plugin_instance_id,
921 int before, 921 int before,
922 int after) { 922 int after) {
923 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>( 923 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(
924 web_contents()->GetFocusedFrame()); 924 web_contents()->GetFocusedFrame());
925 if (rfh) 925 if (rfh)
926 rfh->ExtendSelectionAndDelete(before, after); 926 rfh->GetFrameInputHandler()->ExtendSelectionAndDelete(before, after);
927 } 927 }
928 928
929 void BrowserPluginGuest::OnLockMouse(bool user_gesture, 929 void BrowserPluginGuest::OnLockMouse(bool user_gesture,
930 bool last_unlocked_by_target, 930 bool last_unlocked_by_target,
931 bool privileged) { 931 bool privileged) {
932 if (pending_lock_request_) { 932 if (pending_lock_request_) {
933 // Immediately reject the lock because only one pointerLock may be active 933 // Immediately reject the lock because only one pointerLock may be active
934 // at a time. 934 // at a time.
935 Send(new ViewMsg_LockMouse_ACK(routing_id(), false)); 935 Send(new ViewMsg_LockMouse_ACK(routing_id(), false));
936 return; 936 return;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 range, character_bounds); 1061 range, character_bounds);
1062 } 1062 }
1063 #endif 1063 #endif
1064 1064
1065 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { 1065 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) {
1066 if (delegate_) 1066 if (delegate_)
1067 delegate_->SetContextMenuPosition(position); 1067 delegate_->SetContextMenuPosition(position);
1068 } 1068 }
1069 1069
1070 } // namespace content 1070 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698