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

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: 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
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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 // TODO(viettrungluu): Move to a separate message filter. 1150 // TODO(viettrungluu): Move to a separate message filter.
1151 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, 1151 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune,
1152 OnSetHistoryLengthAndPrune) 1152 OnSetHistoryLengthAndPrune)
1153 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1153 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1154 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) 1154 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode)
1155 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) 1155 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener)
1156 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, 1156 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap,
1157 OnReleaseDisambiguationPopupBitmap) 1157 OnReleaseDisambiguationPopupBitmap)
1158 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, 1158 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted,
1159 OnWindowSnapshotCompleted) 1159 OnWindowSnapshotCompleted)
1160 IPC_MESSAGE_HANDLER(ViewMsg_SelectForSearch, OnSelectForSearch)
1160 #if defined(OS_ANDROID) 1161 #if defined(OS_ANDROID)
1161 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, 1162 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult,
1162 OnActivateNearestFindResult) 1163 OnActivateNearestFindResult)
1163 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) 1164 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects)
1164 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1165 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1165 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, 1166 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState,
1166 OnUpdateTopControlsState) 1167 OnUpdateTopControlsState)
1167 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo) 1168 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo)
1168 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) 1169 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData)
1169 #elif defined(OS_MACOSX) 1170 #elif defined(OS_MACOSX)
(...skipping 13 matching lines...) Expand all
1183 1184
1184 if (!msg_is_ok) { 1185 if (!msg_is_ok) {
1185 // The message had a handler, but its deserialization failed. 1186 // The message had a handler, but its deserialization failed.
1186 // Kill the renderer to avoid potential spoofing attacks. 1187 // Kill the renderer to avoid potential spoofing attacks.
1187 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; 1188 CHECK(false) << "Unable to deserialize message in RenderViewImpl.";
1188 } 1189 }
1189 1190
1190 return handled; 1191 return handled;
1191 } 1192 }
1192 1193
1194 void RenderViewImpl::OnSelectForSearch() {
1195 RenderWidget::OnSelectForSearch();
1196 }
1197
1193 void RenderViewImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { 1198 void RenderViewImpl::OnNavigate(const FrameMsg_Navigate_Params& params) {
1194 FOR_EACH_OBSERVER(RenderViewObserver, observers_, Navigate(params.url)); 1199 FOR_EACH_OBSERVER(RenderViewObserver, observers_, Navigate(params.url));
1195 } 1200 }
1196 1201
1197 bool RenderViewImpl::IsBackForwardToStaleEntry( 1202 bool RenderViewImpl::IsBackForwardToStaleEntry(
1198 const FrameMsg_Navigate_Params& params, 1203 const FrameMsg_Navigate_Params& params,
1199 bool is_reload) { 1204 bool is_reload) {
1200 // Make sure this isn't a back/forward to an entry we have already cropped 1205 // Make sure this isn't a back/forward to an entry we have already cropped
1201 // or replaced from our history, before the browser knew about it. If so, 1206 // or replaced from our history, before the browser knew about it. If so,
1202 // a new navigation has committed in the mean time, and we can ignore this. 1207 // a new navigation has committed in the mean time, and we can ignore this.
(...skipping 3190 matching lines...) Expand 10 before | Expand all | Expand 10 after
4393 std::vector<gfx::Size> sizes; 4398 std::vector<gfx::Size> sizes;
4394 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4399 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4395 if (!url.isEmpty()) 4400 if (!url.isEmpty())
4396 urls.push_back( 4401 urls.push_back(
4397 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4402 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4398 } 4403 }
4399 SendUpdateFaviconURL(urls); 4404 SendUpdateFaviconURL(urls);
4400 } 4405 }
4401 4406
4402 } // namespace content 4407 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698