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 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 return true; | 1296 return true; |
1297 | 1297 |
1298 bool handled = true; | 1298 bool handled = true; |
1299 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) | 1299 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) |
1300 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) | 1300 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) |
1301 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) | 1301 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) |
1302 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, | 1302 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, |
1303 OnScrollFocusedEditableNodeIntoRect) | 1303 OnScrollFocusedEditableNodeIntoRect) |
1304 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, | 1304 IPC_MESSAGE_HANDLER(InputMsg_SetEditCommandsForNextKeyEvent, |
1305 OnSetEditCommandsForNextKeyEvent) | 1305 OnSetEditCommandsForNextKeyEvent) |
1306 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) | |
1307 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 1306 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
1308 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) | 1307 IPC_MESSAGE_HANDLER(ViewMsg_SaveImageAt, OnSaveImageAt) |
1309 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) | 1308 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) |
1310 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) | 1309 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) |
1311 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 1310 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
1312 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, | 1311 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
1313 OnSetZoomLevelForLoadingURL) | 1312 OnSetZoomLevelForLoadingURL) |
1314 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, | 1313 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForView, |
1315 OnSetZoomLevelForView) | 1314 OnSetZoomLevelForView) |
1316 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) | 1315 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 // Otherwise we've removed an earlier entry and should have shifted all | 1428 // Otherwise we've removed an earlier entry and should have shifted all |
1430 // entries left. For now, it's ok to lazily update the list. | 1429 // entries left. For now, it's ok to lazily update the list. |
1431 // TODO(creis): Notify all live renderers when we remove entries from | 1430 // TODO(creis): Notify all live renderers when we remove entries from |
1432 // the front of the list, so that we don't hit this case. | 1431 // the front of the list, so that we don't hit this case. |
1433 history_page_ids_[params.pending_history_list_offset] = params.page_id; | 1432 history_page_ids_[params.pending_history_list_offset] = params.page_id; |
1434 } | 1433 } |
1435 | 1434 |
1436 return false; | 1435 return false; |
1437 } | 1436 } |
1438 | 1437 |
1439 // Stop loading the current page. | |
1440 void RenderViewImpl::OnStop() { | |
1441 if (webview()) | |
1442 webview()->mainFrame()->stopLoading(); | |
1443 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnStop()); | |
1444 main_render_frame_->OnStop(); | |
1445 } | |
1446 | |
1447 void RenderViewImpl::OnCopyImageAt(int x, int y) { | 1438 void RenderViewImpl::OnCopyImageAt(int x, int y) { |
1448 webview()->copyImageAt(WebPoint(x, y)); | 1439 webview()->copyImageAt(WebPoint(x, y)); |
1449 } | 1440 } |
1450 | 1441 |
1451 void RenderViewImpl::OnSaveImageAt(int x, int y) { | 1442 void RenderViewImpl::OnSaveImageAt(int x, int y) { |
1452 webview()->saveImageAt(WebPoint(x, y)); | 1443 webview()->saveImageAt(WebPoint(x, y)); |
1453 } | 1444 } |
1454 | 1445 |
1455 void RenderViewImpl::OnUpdateTargetURLAck() { | 1446 void RenderViewImpl::OnUpdateTargetURLAck() { |
1456 // Check if there is a targeturl waiting to be sent. | 1447 // Check if there is a targeturl waiting to be sent. |
(...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4210 std::vector<gfx::Size> sizes; | 4201 std::vector<gfx::Size> sizes; |
4211 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4202 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4212 if (!url.isEmpty()) | 4203 if (!url.isEmpty()) |
4213 urls.push_back( | 4204 urls.push_back( |
4214 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4205 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4215 } | 4206 } |
4216 SendUpdateFaviconURL(urls); | 4207 SendUpdateFaviconURL(urls); |
4217 } | 4208 } |
4218 | 4209 |
4219 } // namespace content | 4210 } // namespace content |
OLD | NEW |