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

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

Issue 267563003: Allow browser process to request selection of word around caret (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 6 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 // TODO(viettrungluu): Move to a separate message filter. 1127 // TODO(viettrungluu): Move to a separate message filter.
1128 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, 1128 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune,
1129 OnSetHistoryLengthAndPrune) 1129 OnSetHistoryLengthAndPrune)
1130 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1130 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1131 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) 1131 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode)
1132 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) 1132 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener)
1133 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, 1133 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap,
1134 OnReleaseDisambiguationPopupBitmap) 1134 OnReleaseDisambiguationPopupBitmap)
1135 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, 1135 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted,
1136 OnWindowSnapshotCompleted) 1136 OnWindowSnapshotCompleted)
1137 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret)
1137 #if defined(OS_ANDROID) 1138 #if defined(OS_ANDROID)
1138 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, 1139 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult,
1139 OnActivateNearestFindResult) 1140 OnActivateNearestFindResult)
1140 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) 1141 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects)
1141 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1142 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1142 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, 1143 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState,
1143 OnUpdateTopControlsState) 1144 OnUpdateTopControlsState)
1144 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo) 1145 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo)
1145 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) 1146 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData)
1146 #elif defined(OS_MACOSX) 1147 #elif defined(OS_MACOSX)
(...skipping 13 matching lines...) Expand all
1160 1161
1161 if (!msg_is_ok) { 1162 if (!msg_is_ok) {
1162 // The message had a handler, but its deserialization failed. 1163 // The message had a handler, but its deserialization failed.
1163 // Kill the renderer to avoid potential spoofing attacks. 1164 // Kill the renderer to avoid potential spoofing attacks.
1164 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; 1165 CHECK(false) << "Unable to deserialize message in RenderViewImpl.";
1165 } 1166 }
1166 1167
1167 return handled; 1168 return handled;
1168 } 1169 }
1169 1170
1171 void RenderViewImpl::OnSelectWordAroundCaret() {
1172 if (!webview())
1173 return;
1174
1175 handling_input_event_ = true;
1176 webview()->focusedFrame()->selectWordAroundCaret();
1177 handling_input_event_ = false;
1178 }
1179
1170 void RenderViewImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { 1180 void RenderViewImpl::OnNavigate(const FrameMsg_Navigate_Params& params) {
1171 FOR_EACH_OBSERVER(RenderViewObserver, observers_, Navigate(params.url)); 1181 FOR_EACH_OBSERVER(RenderViewObserver, observers_, Navigate(params.url));
1172 } 1182 }
1173 1183
1174 bool RenderViewImpl::IsBackForwardToStaleEntry( 1184 bool RenderViewImpl::IsBackForwardToStaleEntry(
1175 const FrameMsg_Navigate_Params& params, 1185 const FrameMsg_Navigate_Params& params,
1176 bool is_reload) { 1186 bool is_reload) {
1177 // Make sure this isn't a back/forward to an entry we have already cropped 1187 // Make sure this isn't a back/forward to an entry we have already cropped
1178 // or replaced from our history, before the browser knew about it. If so, 1188 // or replaced from our history, before the browser knew about it. If so,
1179 // a new navigation has committed in the mean time, and we can ignore this. 1189 // a new navigation has committed in the mean time, and we can ignore this.
(...skipping 2968 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 std::vector<gfx::Size> sizes; 4158 std::vector<gfx::Size> sizes;
4149 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4159 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4150 if (!url.isEmpty()) 4160 if (!url.isEmpty())
4151 urls.push_back( 4161 urls.push_back(
4152 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4162 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4153 } 4163 }
4154 SendUpdateFaviconURL(urls); 4164 SendUpdateFaviconURL(urls);
4155 } 4165 }
4156 4166
4157 } // namespace content 4167 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698