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/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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 #include "media/renderers/gpu_video_accelerator_factories.h" | 106 #include "media/renderers/gpu_video_accelerator_factories.h" |
107 #include "net/base/data_url.h" | 107 #include "net/base/data_url.h" |
108 #include "net/base/escape.h" | 108 #include "net/base/escape.h" |
109 #include "net/base/net_errors.h" | 109 #include "net/base/net_errors.h" |
110 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 110 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
111 #include "net/http/http_util.h" | 111 #include "net/http/http_util.h" |
112 #include "skia/ext/platform_canvas.h" | 112 #include "skia/ext/platform_canvas.h" |
113 #include "third_party/WebKit/public/platform/WebCString.h" | 113 #include "third_party/WebKit/public/platform/WebCString.h" |
114 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 114 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
115 #include "third_party/WebKit/public/platform/WebDragData.h" | 115 #include "third_party/WebKit/public/platform/WebDragData.h" |
116 #include "third_party/WebKit/public/platform/WebFocusType.h" | |
116 #include "third_party/WebKit/public/platform/WebHTTPBody.h" | 117 #include "third_party/WebKit/public/platform/WebHTTPBody.h" |
117 #include "third_party/WebKit/public/platform/WebImage.h" | 118 #include "third_party/WebKit/public/platform/WebImage.h" |
118 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" | 119 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" |
119 #include "third_party/WebKit/public/platform/WebPoint.h" | 120 #include "third_party/WebKit/public/platform/WebPoint.h" |
120 #include "third_party/WebKit/public/platform/WebRect.h" | 121 #include "third_party/WebKit/public/platform/WebRect.h" |
121 #include "third_party/WebKit/public/platform/WebSize.h" | 122 #include "third_party/WebKit/public/platform/WebSize.h" |
122 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" | 123 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" |
123 #include "third_party/WebKit/public/platform/WebString.h" | 124 #include "third_party/WebKit/public/platform/WebString.h" |
124 #include "third_party/WebKit/public/platform/WebURL.h" | 125 #include "third_party/WebKit/public/platform/WebURL.h" |
125 #include "third_party/WebKit/public/platform/WebURLError.h" | 126 #include "third_party/WebKit/public/platform/WebURLError.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
219 using blink::WebColor; | 220 using blink::WebColor; |
220 using blink::WebColorName; | 221 using blink::WebColorName; |
221 using blink::WebConsoleMessage; | 222 using blink::WebConsoleMessage; |
222 using blink::WebData; | 223 using blink::WebData; |
223 using blink::WebDataSource; | 224 using blink::WebDataSource; |
224 using blink::WebDocument; | 225 using blink::WebDocument; |
225 using blink::WebDragData; | 226 using blink::WebDragData; |
226 using blink::WebDragOperation; | 227 using blink::WebDragOperation; |
227 using blink::WebDragOperationsMask; | 228 using blink::WebDragOperationsMask; |
228 using blink::WebElement; | 229 using blink::WebElement; |
230 using blink::WebFocusType; | |
jdduke (slow)
2015/04/15 18:42:46
We only use this once, don't think it merits a usi
AKV
2015/04/17 15:48:16
Done.
| |
229 using blink::WebFileChooserCompletion; | 231 using blink::WebFileChooserCompletion; |
230 using blink::WebFindOptions; | 232 using blink::WebFindOptions; |
231 using blink::WebFormControlElement; | 233 using blink::WebFormControlElement; |
232 using blink::WebFormElement; | 234 using blink::WebFormElement; |
233 using blink::WebFrame; | 235 using blink::WebFrame; |
234 using blink::WebGestureEvent; | 236 using blink::WebGestureEvent; |
235 using blink::WebHistoryItem; | 237 using blink::WebHistoryItem; |
236 using blink::WebHTTPBody; | 238 using blink::WebHTTPBody; |
237 using blink::WebIconURL; | 239 using blink::WebIconURL; |
238 using blink::WebImage; | 240 using blink::WebImage; |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1255 return true; | 1257 return true; |
1256 | 1258 |
1257 bool handled = true; | 1259 bool handled = true; |
1258 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) | 1260 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) |
1259 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) | 1261 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) |
1260 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) | 1262 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) |
1261 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, | 1263 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, |
1262 OnScrollFocusedEditableNodeIntoRect) | 1264 OnScrollFocusedEditableNodeIntoRect) |
1263 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, | 1265 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, |
1264 OnSetEditCommandsForNextKeyEvent) | 1266 OnSetEditCommandsForNextKeyEvent) |
1267 IPC_MESSAGE_HANDLER(InputMsg_AdvanceFocusToNextInputField, | |
1268 OnAdvanceFocusToNextInputField) | |
1265 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 1269 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
1266 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) | 1270 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) |
1267 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) | 1271 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) |
1268 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) | 1272 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) |
1269 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageScale, OnResetPageScale) | 1273 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageScale, OnResetPageScale) |
1270 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 1274 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
1271 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, | 1275 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
1272 OnSetZoomLevelForLoadingURL) | 1276 OnSetZoomLevelForLoadingURL) |
1273 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, | 1277 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, |
1274 OnSetZoomLevelForView) | 1278 OnSetZoomLevelForView) |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1416 | 1420 |
1417 void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset, | 1421 void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset, |
1418 int history_length) { | 1422 int history_length) { |
1419 DCHECK_GE(history_offset, -1); | 1423 DCHECK_GE(history_offset, -1); |
1420 DCHECK_GE(history_length, 0); | 1424 DCHECK_GE(history_length, 0); |
1421 | 1425 |
1422 history_list_offset_ = history_offset; | 1426 history_list_offset_ = history_offset; |
1423 history_list_length_ = history_length; | 1427 history_list_length_ = history_length; |
1424 } | 1428 } |
1425 | 1429 |
1430 void RenderViewImpl::OnAdvanceFocusToNextInputField(bool forward) { | |
1431 if (!webview()) | |
1432 return; | |
1433 | |
1434 WebFocusType focusType = blink::WebFocusTypeForward; | |
1435 if (forward == false) | |
1436 focusType = blink::WebFocusTypeBackward; | |
1437 webview()->advanceFocusToNextInputField(focusType); | |
1438 } | |
1439 | |
1426 void RenderViewImpl::OnSetInitialFocus(bool reverse) { | 1440 void RenderViewImpl::OnSetInitialFocus(bool reverse) { |
1427 if (!webview()) | 1441 if (!webview()) |
1428 return; | 1442 return; |
1429 webview()->setInitialFocus(reverse); | 1443 webview()->setInitialFocus(reverse); |
1430 } | 1444 } |
1431 | 1445 |
1432 #if defined(OS_MACOSX) | 1446 #if defined(OS_MACOSX) |
1433 void RenderViewImpl::OnSetInLiveResize(bool in_live_resize) { | 1447 void RenderViewImpl::OnSetInLiveResize(bool in_live_resize) { |
1434 if (!webview()) | 1448 if (!webview()) |
1435 return; | 1449 return; |
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3741 std::vector<gfx::Size> sizes; | 3755 std::vector<gfx::Size> sizes; |
3742 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3756 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3743 if (!url.isEmpty()) | 3757 if (!url.isEmpty()) |
3744 urls.push_back( | 3758 urls.push_back( |
3745 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3759 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3746 } | 3760 } |
3747 SendUpdateFaviconURL(urls); | 3761 SendUpdateFaviconURL(urls); |
3748 } | 3762 } |
3749 | 3763 |
3750 } // namespace content | 3764 } // namespace content |
OLD | NEW |