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 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 return true; | 1310 return true; |
1311 | 1311 |
1312 bool handled = true; | 1312 bool handled = true; |
1313 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) | 1313 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) |
1314 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) | 1314 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) |
1315 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) | 1315 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) |
1316 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, | 1316 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, |
1317 OnScrollFocusedEditableNodeIntoRect) | 1317 OnScrollFocusedEditableNodeIntoRect) |
1318 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, | 1318 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, |
1319 OnSetEditCommandsForNextKeyEvent) | 1319 OnSetEditCommandsForNextKeyEvent) |
1320 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) | |
1321 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 1320 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
1322 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) | 1321 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) |
1323 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) | 1322 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) |
1324 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) | 1323 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) |
1325 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 1324 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
1326 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, | 1325 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
1327 OnSetZoomLevelForLoadingURL) | 1326 OnSetZoomLevelForLoadingURL) |
1328 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, | 1327 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, |
1329 OnSetZoomLevelForView) | 1328 OnSetZoomLevelForView) |
1330 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) | 1329 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 // Otherwise we've removed an earlier entry and should have shifted all | 1445 // Otherwise we've removed an earlier entry and should have shifted all |
1447 // entries left. For now, it's ok to lazily update the list. | 1446 // entries left. For now, it's ok to lazily update the list. |
1448 // TODO(creis): Notify all live renderers when we remove entries from | 1447 // TODO(creis): Notify all live renderers when we remove entries from |
1449 // the front of the list, so that we don't hit this case. | 1448 // the front of the list, so that we don't hit this case. |
1450 history_page_ids_[params.pending_history_list_offset] = params.page_id; | 1449 history_page_ids_[params.pending_history_list_offset] = params.page_id; |
1451 } | 1450 } |
1452 | 1451 |
1453 return false; | 1452 return false; |
1454 } | 1453 } |
1455 | 1454 |
1456 // Stop loading the current page. | |
1457 void RenderViewImpl::OnStop() { | |
1458 if (webview()) | |
1459 webview()->mainFrame()->stopLoading(); | |
1460 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnStop()); | |
1461 main_render_frame_->OnStop(); | |
1462 } | |
1463 | |
1464 void RenderViewImpl::OnCopyImageAt(int x, int y) { | 1455 void RenderViewImpl::OnCopyImageAt(int x, int y) { |
1465 webview()->copyImageAt(WebPoint(x, y)); | 1456 webview()->copyImageAt(WebPoint(x, y)); |
1466 } | 1457 } |
1467 | 1458 |
1468 void RenderViewImpl::OnSaveImageAt(int x, int y) { | 1459 void RenderViewImpl::OnSaveImageAt(int x, int y) { |
1469 webview()->saveImageAt(WebPoint(x, y)); | 1460 webview()->saveImageAt(WebPoint(x, y)); |
1470 } | 1461 } |
1471 | 1462 |
1472 void RenderViewImpl::OnUpdateTargetURLAck() { | 1463 void RenderViewImpl::OnUpdateTargetURLAck() { |
1473 // Check if there is a targeturl waiting to be sent. | 1464 // Check if there is a targeturl waiting to be sent. |
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4275 std::vector<gfx::Size> sizes; | 4266 std::vector<gfx::Size> sizes; |
4276 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4267 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4277 if (!url.isEmpty()) | 4268 if (!url.isEmpty()) |
4278 urls.push_back( | 4269 urls.push_back( |
4279 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4270 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4280 } | 4271 } |
4281 SendUpdateFaviconURL(urls); | 4272 SendUpdateFaviconURL(urls); |
4282 } | 4273 } |
4283 | 4274 |
4284 } // namespace content | 4275 } // namespace content |
OLD | NEW |