| 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 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1039 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| 1040 IPC_MESSAGE_HANDLER(JavaBridgeMsg_Init, OnJavaBridgeInit) | 1040 IPC_MESSAGE_HANDLER(JavaBridgeMsg_Init, OnJavaBridgeInit) |
| 1041 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) | 1041 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) |
| 1042 IPC_MESSAGE_HANDLER(ViewMsg_UpdateFrameTree, OnUpdatedFrameTree) | 1042 IPC_MESSAGE_HANDLER(ViewMsg_UpdateFrameTree, OnUpdatedFrameTree) |
| 1043 #if defined(OS_ANDROID) | 1043 #if defined(OS_ANDROID) |
| 1044 IPC_MESSAGE_HANDLER(ViewMsg_ActivateNearestFindResult, | 1044 IPC_MESSAGE_HANDLER(ViewMsg_ActivateNearestFindResult, |
| 1045 OnActivateNearestFindResult) | 1045 OnActivateNearestFindResult) |
| 1046 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) | 1046 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) |
| 1047 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1047 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
| 1048 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewMsg_SynchronousFind, OnSynchronousFind) | 1048 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewMsg_SynchronousFind, OnSynchronousFind) |
| 1049 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView, |
| 1050 OnUndoScrollFocusedEditableNodeIntoRect) |
| 1049 #elif defined(OS_MACOSX) | 1051 #elif defined(OS_MACOSX) |
| 1050 IPC_MESSAGE_HANDLER(ViewMsg_CopyToFindPboard, OnCopyToFindPboard) | 1052 IPC_MESSAGE_HANDLER(ViewMsg_CopyToFindPboard, OnCopyToFindPboard) |
| 1051 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, | 1053 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, |
| 1052 OnPluginImeCompositionCompleted) | 1054 OnPluginImeCompositionCompleted) |
| 1053 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 1055 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
| 1054 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) | 1056 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) |
| 1055 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) | 1057 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) |
| 1056 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) | 1058 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) |
| 1057 #endif | 1059 #endif |
| 1058 | 1060 |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1465 webview()->willStartLiveResize(); | 1467 webview()->willStartLiveResize(); |
| 1466 else | 1468 else |
| 1467 webview()->willEndLiveResize(); | 1469 webview()->willEndLiveResize(); |
| 1468 } | 1470 } |
| 1469 #endif | 1471 #endif |
| 1470 | 1472 |
| 1471 void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect( | 1473 void RenderViewImpl::OnScrollFocusedEditableNodeIntoRect( |
| 1472 const gfx::Rect& rect) { | 1474 const gfx::Rect& rect) { |
| 1473 WebKit::WebNode node = GetFocusedNode(); | 1475 WebKit::WebNode node = GetFocusedNode(); |
| 1474 if (!node.isNull()) { | 1476 if (!node.isNull()) { |
| 1475 if (IsEditableNode(node)) | 1477 if (IsEditableNode(node)) { |
| 1478 webview()->saveScrollAndScaleState(); |
| 1476 webview()->scrollFocusedNodeIntoRect(rect); | 1479 webview()->scrollFocusedNodeIntoRect(rect); |
| 1480 } |
| 1477 } | 1481 } |
| 1478 } | 1482 } |
| 1479 | 1483 |
| 1484 #if defined(OS_ANDROID) |
| 1485 void RenderViewImpl::OnUndoScrollFocusedEditableNodeIntoRect() { |
| 1486 const WebNode node = GetFocusedNode(); |
| 1487 if (!node.isNull() && IsEditableNode(node)) |
| 1488 webview()->restoreScrollAndScaleState(); |
| 1489 } |
| 1490 #endif |
| 1491 |
| 1480 /////////////////////////////////////////////////////////////////////////////// | 1492 /////////////////////////////////////////////////////////////////////////////// |
| 1481 | 1493 |
| 1482 // Tell the embedding application that the URL of the active page has changed | 1494 // Tell the embedding application that the URL of the active page has changed |
| 1483 void RenderViewImpl::UpdateURL(WebFrame* frame) { | 1495 void RenderViewImpl::UpdateURL(WebFrame* frame) { |
| 1484 WebDataSource* ds = frame->dataSource(); | 1496 WebDataSource* ds = frame->dataSource(); |
| 1485 DCHECK(ds); | 1497 DCHECK(ds); |
| 1486 | 1498 |
| 1487 const WebURLRequest& request = ds->request(); | 1499 const WebURLRequest& request = ds->request(); |
| 1488 const WebURLRequest& original_request = ds->originalRequest(); | 1500 const WebURLRequest& original_request = ds->originalRequest(); |
| 1489 const WebURLResponse& response = ds->response(); | 1501 const WebURLResponse& response = ds->response(); |
| (...skipping 4831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6321 | 6333 |
| 6322 updating_frame_tree_ = true; | 6334 updating_frame_tree_ = true; |
| 6323 active_frame_id_map_.clear(); | 6335 active_frame_id_map_.clear(); |
| 6324 | 6336 |
| 6325 target_process_id_ = process_id; | 6337 target_process_id_ = process_id; |
| 6326 target_routing_id_ = route_id; | 6338 target_routing_id_ = route_id; |
| 6327 CreateFrameTree(webview()->mainFrame(), frames); | 6339 CreateFrameTree(webview()->mainFrame(), frames); |
| 6328 | 6340 |
| 6329 updating_frame_tree_ = false; | 6341 updating_frame_tree_ = false; |
| 6330 } | 6342 } |
| OLD | NEW |