| 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 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 return true; | 1279 return true; |
| 1279 | 1280 |
| 1280 bool handled = true; | 1281 bool handled = true; |
| 1281 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) | 1282 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) |
| 1282 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) | 1283 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) |
| 1283 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) | 1284 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) |
| 1284 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, | 1285 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, |
| 1285 OnScrollFocusedEditableNodeIntoRect) | 1286 OnScrollFocusedEditableNodeIntoRect) |
| 1286 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, | 1287 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, |
| 1287 OnSetEditCommandsForNextKeyEvent) | 1288 OnSetEditCommandsForNextKeyEvent) |
| 1289 IPC_MESSAGE_HANDLER(InputMsg_AdvanceFocusInForm, OnAdvanceFocusInForm) |
| 1288 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 1290 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
| 1289 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) | 1291 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) |
| 1290 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) | 1292 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) |
| 1291 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) | 1293 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) |
| 1292 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageScale, OnResetPageScale) | 1294 IPC_MESSAGE_HANDLER(ViewMsg_ResetPageScale, OnResetPageScale) |
| 1293 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 1295 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
| 1294 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, | 1296 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
| 1295 OnSetZoomLevelForLoadingURL) | 1297 OnSetZoomLevelForLoadingURL) |
| 1296 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, | 1298 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, |
| 1297 OnSetZoomLevelForView) | 1299 OnSetZoomLevelForView) |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1439 | 1441 |
| 1440 void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset, | 1442 void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset, |
| 1441 int history_length) { | 1443 int history_length) { |
| 1442 DCHECK_GE(history_offset, -1); | 1444 DCHECK_GE(history_offset, -1); |
| 1443 DCHECK_GE(history_length, 0); | 1445 DCHECK_GE(history_length, 0); |
| 1444 | 1446 |
| 1445 history_list_offset_ = history_offset; | 1447 history_list_offset_ = history_offset; |
| 1446 history_list_length_ = history_length; | 1448 history_list_length_ = history_length; |
| 1447 } | 1449 } |
| 1448 | 1450 |
| 1451 void RenderViewImpl::OnAdvanceFocusInForm(bool forward) { |
| 1452 if (!webview()) |
| 1453 return; |
| 1454 |
| 1455 blink::WebFocusType focus_type = |
| 1456 forward ? blink::WebFocusTypeForward : blink::WebFocusTypeBackward; |
| 1457 webview()->advanceFocusInForm(focus_type); |
| 1458 } |
| 1459 |
| 1449 void RenderViewImpl::OnSetInitialFocus(bool reverse) { | 1460 void RenderViewImpl::OnSetInitialFocus(bool reverse) { |
| 1450 if (!webview()) | 1461 if (!webview()) |
| 1451 return; | 1462 return; |
| 1452 webview()->setInitialFocus(reverse); | 1463 webview()->setInitialFocus(reverse); |
| 1453 } | 1464 } |
| 1454 | 1465 |
| 1455 #if defined(OS_MACOSX) | 1466 #if defined(OS_MACOSX) |
| 1456 void RenderViewImpl::OnSetInLiveResize(bool in_live_resize) { | 1467 void RenderViewImpl::OnSetInLiveResize(bool in_live_resize) { |
| 1457 if (!webview()) | 1468 if (!webview()) |
| 1458 return; | 1469 return; |
| (...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3770 std::vector<gfx::Size> sizes; | 3781 std::vector<gfx::Size> sizes; |
| 3771 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3782 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 3772 if (!url.isEmpty()) | 3783 if (!url.isEmpty()) |
| 3773 urls.push_back( | 3784 urls.push_back( |
| 3774 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3785 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 3775 } | 3786 } |
| 3776 SendUpdateFaviconURL(urls); | 3787 SendUpdateFaviconURL(urls); |
| 3777 } | 3788 } |
| 3778 | 3789 |
| 3779 } // namespace content | 3790 } // namespace content |
| OLD | NEW |