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

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

Issue 829913004: WIP: Plumbing through text selection granularity control support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unified_text_selection_diff
Patch Set: Missing file. Created 5 years, 11 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
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | ui/touch_selection/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #include "net/http/http_util.h" 110 #include "net/http/http_util.h"
111 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" 111 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h"
112 #include "third_party/WebKit/public/platform/WebString.h" 112 #include "third_party/WebKit/public/platform/WebString.h"
113 #include "third_party/WebKit/public/platform/WebURL.h" 113 #include "third_party/WebKit/public/platform/WebURL.h"
114 #include "third_party/WebKit/public/platform/WebURLError.h" 114 #include "third_party/WebKit/public/platform/WebURLError.h"
115 #include "third_party/WebKit/public/platform/WebURLResponse.h" 115 #include "third_party/WebKit/public/platform/WebURLResponse.h"
116 #include "third_party/WebKit/public/platform/WebVector.h" 116 #include "third_party/WebKit/public/platform/WebVector.h"
117 #include "third_party/WebKit/public/web/WebColorSuggestion.h" 117 #include "third_party/WebKit/public/web/WebColorSuggestion.h"
118 #include "third_party/WebKit/public/web/WebDocument.h" 118 #include "third_party/WebKit/public/web/WebDocument.h"
119 #include "third_party/WebKit/public/web/WebGlyphCache.h" 119 #include "third_party/WebKit/public/web/WebGlyphCache.h"
120 #include "third_party/WebKit/public/web/WebLocalFrame.h"
121 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" 120 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h"
122 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" 121 #include "third_party/WebKit/public/web/WebNavigationPolicy.h"
123 #include "third_party/WebKit/public/web/WebPlugin.h" 122 #include "third_party/WebKit/public/web/WebPlugin.h"
124 #include "third_party/WebKit/public/web/WebPluginParams.h" 123 #include "third_party/WebKit/public/web/WebPluginParams.h"
125 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h" 124 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h"
126 #include "third_party/WebKit/public/web/WebRange.h" 125 #include "third_party/WebKit/public/web/WebRange.h"
127 #include "third_party/WebKit/public/web/WebScriptSource.h" 126 #include "third_party/WebKit/public/web/WebScriptSource.h"
128 #include "third_party/WebKit/public/web/WebSearchableFormData.h" 127 #include "third_party/WebKit/public/web/WebSearchableFormData.h"
129 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" 128 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
130 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 129 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 1301
1303 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); 1302 base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
1304 frame_->selectRange(base, extent); 1303 frame_->selectRange(base, extent);
1305 } 1304 }
1306 1305
1307 void RenderFrameImpl::OnUnselect() { 1306 void RenderFrameImpl::OnUnselect() {
1308 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); 1307 base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
1309 frame_->executeCommand(WebString::fromUTF8("Unselect"), GetFocusedElement()); 1308 frame_->executeCommand(WebString::fromUTF8("Unselect"), GetFocusedElement());
1310 } 1309 }
1311 1310
1312 void RenderFrameImpl::OnMoveRangeSelectionExtent(const gfx::Point& point) { 1311 void RenderFrameImpl::OnMoveRangeSelectionExtent(
1312 const gfx::Point& point,
1313 blink::WebLocalFrame::TextGranularity granularity) {
1313 // This IPC is dispatched by RenderWidgetHost, so use its routing id. 1314 // This IPC is dispatched by RenderWidgetHost, so use its routing id.
1314 Send(new InputHostMsg_MoveRangeSelectionExtent_ACK( 1315 Send(new InputHostMsg_MoveRangeSelectionExtent_ACK(
1315 GetRenderWidget()->routing_id())); 1316 GetRenderWidget()->routing_id()));
1316 1317
1317 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); 1318 base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
1318 frame_->moveRangeSelectionExtent(point); 1319 frame_->moveRangeSelectionExtent(point, granularity);
1319 } 1320 }
1320 1321
1321 void RenderFrameImpl::OnReplace(const base::string16& text) { 1322 void RenderFrameImpl::OnReplace(const base::string16& text) {
1322 if (!frame_->hasSelection()) 1323 if (!frame_->hasSelection())
1323 frame_->selectWordAroundCaret(); 1324 frame_->selectWordAroundCaret();
1324 1325
1325 frame_->replaceSelection(text); 1326 frame_->replaceSelection(text);
1326 } 1327 }
1327 1328
1328 void RenderFrameImpl::OnReplaceMisspelling(const base::string16& text) { 1329 void RenderFrameImpl::OnReplaceMisspelling(const base::string16& text) {
(...skipping 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after
4315 4316
4316 #if defined(ENABLE_BROWSER_CDMS) 4317 #if defined(ENABLE_BROWSER_CDMS)
4317 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 4318 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
4318 if (!cdm_manager_) 4319 if (!cdm_manager_)
4319 cdm_manager_ = new RendererCdmManager(this); 4320 cdm_manager_ = new RendererCdmManager(this);
4320 return cdm_manager_; 4321 return cdm_manager_;
4321 } 4322 }
4322 #endif // defined(ENABLE_BROWSER_CDMS) 4323 #endif // defined(ENABLE_BROWSER_CDMS)
4323 4324
4324 } // namespace content 4325 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | ui/touch_selection/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698