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