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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 657803002: Update touch selection to only modify one selection point at a time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo) 817 IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo)
818 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo) 818 IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo)
819 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut) 819 IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut)
820 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy) 820 IPC_MESSAGE_HANDLER(InputMsg_Copy, OnCopy)
821 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste) 821 IPC_MESSAGE_HANDLER(InputMsg_Paste, OnPaste)
822 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) 822 IPC_MESSAGE_HANDLER(InputMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
823 IPC_MESSAGE_HANDLER(InputMsg_Delete, OnDelete) 823 IPC_MESSAGE_HANDLER(InputMsg_Delete, OnDelete)
824 IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll) 824 IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll)
825 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange) 825 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange)
826 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) 826 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect)
827 IPC_MESSAGE_HANDLER(InputMsg_MoveSelectionExtent, OnMoveSelectionExtent)
827 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) 828 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace)
828 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) 829 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling)
829 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, 830 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete,
830 OnExtendSelectionAndDelete) 831 OnExtendSelectionAndDelete)
831 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, 832 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText,
832 OnSetCompositionFromExistingText) 833 OnSetCompositionFromExistingText)
833 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) 834 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest)
834 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, 835 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest,
835 OnJavaScriptExecuteRequest) 836 OnJavaScriptExecuteRequest)
836 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, 837 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests,
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 1218
1218 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); 1219 base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
1219 frame_->selectRange(start, end); 1220 frame_->selectRange(start, end);
1220 } 1221 }
1221 1222
1222 void RenderFrameImpl::OnUnselect() { 1223 void RenderFrameImpl::OnUnselect() {
1223 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); 1224 base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
1224 frame_->executeCommand(WebString::fromUTF8("Unselect"), GetFocusedElement()); 1225 frame_->executeCommand(WebString::fromUTF8("Unselect"), GetFocusedElement());
1225 } 1226 }
1226 1227
1228 void RenderFrameImpl::OnMoveSelectionExtent(const gfx::Point& point) {
1229 // This IPC is dispatched by RenderWidgetHost, so use its routing id.
1230 Send(new ViewHostMsg_MoveSelectionExtent_ACK(
1231 GetRenderWidget()->routing_id()));
1232
1233 base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
1234 frame_->moveSelectionExtent(point);
1235 }
1236
1227 void RenderFrameImpl::OnReplace(const base::string16& text) { 1237 void RenderFrameImpl::OnReplace(const base::string16& text) {
1228 if (!frame_->hasSelection()) 1238 if (!frame_->hasSelection())
1229 frame_->selectWordAroundCaret(); 1239 frame_->selectWordAroundCaret();
1230 1240
1231 frame_->replaceSelection(text); 1241 frame_->replaceSelection(text);
1232 } 1242 }
1233 1243
1234 void RenderFrameImpl::OnReplaceMisspelling(const base::string16& text) { 1244 void RenderFrameImpl::OnReplaceMisspelling(const base::string16& text) {
1235 if (!frame_->hasSelection()) 1245 if (!frame_->hasSelection())
1236 return; 1246 return;
(...skipping 2737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3974 3984
3975 #if defined(ENABLE_BROWSER_CDMS) 3985 #if defined(ENABLE_BROWSER_CDMS)
3976 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 3986 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
3977 if (!cdm_manager_) 3987 if (!cdm_manager_)
3978 cdm_manager_ = new RendererCdmManager(this); 3988 cdm_manager_ = new RendererCdmManager(this);
3979 return cdm_manager_; 3989 return cdm_manager_;
3980 } 3990 }
3981 #endif // defined(ENABLE_BROWSER_CDMS) 3991 #endif // defined(ENABLE_BROWSER_CDMS)
3982 3992
3983 } // namespace content 3993 } // namespace content
OLDNEW
« content/common/view_messages.h ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698