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/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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 last_drag_status_ = drag_status; | 891 last_drag_status_ = drag_status; |
892 EndSystemDragIfApplicable(); | 892 EndSystemDragIfApplicable(); |
893 } | 893 } |
894 | 894 |
895 void BrowserPluginGuest::OnExecuteEditCommand(int browser_plugin_instance_id, | 895 void BrowserPluginGuest::OnExecuteEditCommand(int browser_plugin_instance_id, |
896 const std::string& name) { | 896 const std::string& name) { |
897 RenderFrameHost* focused_frame = web_contents()->GetFocusedFrame(); | 897 RenderFrameHost* focused_frame = web_contents()->GetFocusedFrame(); |
898 if (!focused_frame) | 898 if (!focused_frame) |
899 return; | 899 return; |
900 | 900 |
901 focused_frame->Send(new InputMsg_ExecuteNoValueEditCommand( | 901 focused_frame->GetFrameInputHandler()->ExecuteEditCommand(name, |
902 focused_frame->GetRoutingID(), name)); | 902 base::nullopt); |
903 } | 903 } |
904 | 904 |
905 void BrowserPluginGuest::OnImeSetComposition( | 905 void BrowserPluginGuest::OnImeSetComposition( |
906 int browser_plugin_instance_id, | 906 int browser_plugin_instance_id, |
907 const BrowserPluginHostMsg_SetComposition_Params& params) { | 907 const BrowserPluginHostMsg_SetComposition_Params& params) { |
908 Send(new InputMsg_ImeSetComposition( | 908 Send(new InputMsg_ImeSetComposition( |
909 routing_id(), params.text, params.underlines, params.replacement_range, | 909 routing_id(), params.text, params.underlines, params.replacement_range, |
910 params.selection_start, params.selection_end)); | 910 params.selection_start, params.selection_end)); |
911 } | 911 } |
912 | 912 |
(...skipping 11 matching lines...) Expand all Loading... |
924 Send(new InputMsg_ImeFinishComposingText(routing_id(), keep_selection)); | 924 Send(new InputMsg_ImeFinishComposingText(routing_id(), keep_selection)); |
925 } | 925 } |
926 | 926 |
927 void BrowserPluginGuest::OnExtendSelectionAndDelete( | 927 void BrowserPluginGuest::OnExtendSelectionAndDelete( |
928 int browser_plugin_instance_id, | 928 int browser_plugin_instance_id, |
929 int before, | 929 int before, |
930 int after) { | 930 int after) { |
931 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>( | 931 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>( |
932 web_contents()->GetFocusedFrame()); | 932 web_contents()->GetFocusedFrame()); |
933 if (rfh) | 933 if (rfh) |
934 rfh->ExtendSelectionAndDelete(before, after); | 934 rfh->GetFrameInputHandler()->ExtendSelectionAndDelete(before, after); |
935 } | 935 } |
936 | 936 |
937 void BrowserPluginGuest::OnLockMouse(bool user_gesture, | 937 void BrowserPluginGuest::OnLockMouse(bool user_gesture, |
938 bool last_unlocked_by_target, | 938 bool last_unlocked_by_target, |
939 bool privileged) { | 939 bool privileged) { |
940 if (pending_lock_request_) { | 940 if (pending_lock_request_) { |
941 // Immediately reject the lock because only one pointerLock may be active | 941 // Immediately reject the lock because only one pointerLock may be active |
942 // at a time. | 942 // at a time. |
943 Send(new ViewMsg_LockMouse_ACK(routing_id(), false)); | 943 Send(new ViewMsg_LockMouse_ACK(routing_id(), false)); |
944 return; | 944 return; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 range, character_bounds); | 1069 range, character_bounds); |
1070 } | 1070 } |
1071 #endif | 1071 #endif |
1072 | 1072 |
1073 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1073 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
1074 if (delegate_) | 1074 if (delegate_) |
1075 delegate_->SetContextMenuPosition(position); | 1075 delegate_->SetContextMenuPosition(position); |
1076 } | 1076 } |
1077 | 1077 |
1078 } // namespace content | 1078 } // namespace content |
OLD | NEW |