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/bind.h" | 10 #include "base/bind.h" |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) | 957 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) |
958 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame) | 958 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame) |
959 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) | 959 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) |
960 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo) | 960 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo) |
961 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut) | 961 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut) |
962 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) | 962 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) |
963 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste) | 963 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste) |
964 IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) | 964 IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) |
965 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace) | 965 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace) |
966 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete) | 966 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete) |
| 967 IPC_MESSAGE_HANDLER(ViewMsg_SetName, OnSetName) |
967 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) | 968 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) |
968 IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect) | 969 IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect) |
969 IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets, | 970 IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets, |
970 OnSetEditableSelectionOffsets) | 971 OnSetEditableSelectionOffsets) |
971 IPC_MESSAGE_HANDLER(ViewMsg_SetCompositionFromExistingText, | 972 IPC_MESSAGE_HANDLER(ViewMsg_SetCompositionFromExistingText, |
972 OnSetCompositionFromExistingText) | 973 OnSetCompositionFromExistingText) |
973 IPC_MESSAGE_HANDLER(ViewMsg_ExtendSelectionAndDelete, | 974 IPC_MESSAGE_HANDLER(ViewMsg_ExtendSelectionAndDelete, |
974 OnExtendSelectionAndDelete) | 975 OnExtendSelectionAndDelete) |
975 IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange) | 976 IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange) |
976 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 977 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 frame->replaceSelection(text); | 1380 frame->replaceSelection(text); |
1380 } | 1381 } |
1381 | 1382 |
1382 void RenderViewImpl::OnDelete() { | 1383 void RenderViewImpl::OnDelete() { |
1383 if (!webview()) | 1384 if (!webview()) |
1384 return; | 1385 return; |
1385 | 1386 |
1386 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Delete")); | 1387 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Delete")); |
1387 } | 1388 } |
1388 | 1389 |
| 1390 void RenderViewImpl::OnSetName(const std::string& name) { |
| 1391 if (!webview()) |
| 1392 return; |
| 1393 |
| 1394 webview()->mainFrame()->setName(WebString::fromUTF8(name)); |
| 1395 } |
| 1396 |
1389 void RenderViewImpl::OnSelectAll() { | 1397 void RenderViewImpl::OnSelectAll() { |
1390 if (!webview()) | 1398 if (!webview()) |
1391 return; | 1399 return; |
1392 | 1400 |
1393 webview()->focusedFrame()->executeCommand( | 1401 webview()->focusedFrame()->executeCommand( |
1394 WebString::fromUTF8("SelectAll")); | 1402 WebString::fromUTF8("SelectAll")); |
1395 } | 1403 } |
1396 | 1404 |
1397 void RenderViewImpl::OnUnselect() { | 1405 void RenderViewImpl::OnUnselect() { |
1398 if (!webview()) | 1406 if (!webview()) |
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2723 if (!updating_frame_tree_) | 2731 if (!updating_frame_tree_) |
2724 SendUpdatedFrameTree(frame); | 2732 SendUpdatedFrameTree(frame); |
2725 | 2733 |
2726 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); | 2734 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); |
2727 } | 2735 } |
2728 | 2736 |
2729 void RenderViewImpl::willClose(WebFrame* frame) { | 2737 void RenderViewImpl::willClose(WebFrame* frame) { |
2730 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); | 2738 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); |
2731 } | 2739 } |
2732 | 2740 |
| 2741 void RenderViewImpl::didChangeName(WebFrame* frame, |
| 2742 const WebString& name) { |
| 2743 Send(new ViewHostMsg_UpdateFrameName(routing_id_, |
| 2744 frame->identifier(), |
| 2745 !frame->parent(), |
| 2746 UTF16ToUTF8(name))); |
| 2747 } |
| 2748 |
2733 void RenderViewImpl::loadURLExternally( | 2749 void RenderViewImpl::loadURLExternally( |
2734 WebFrame* frame, const WebURLRequest& request, | 2750 WebFrame* frame, const WebURLRequest& request, |
2735 WebNavigationPolicy policy) { | 2751 WebNavigationPolicy policy) { |
2736 loadURLExternally(frame, request, policy, WebString()); | 2752 loadURLExternally(frame, request, policy, WebString()); |
2737 } | 2753 } |
2738 | 2754 |
2739 void RenderViewImpl::Repaint(const gfx::Size& size) { | 2755 void RenderViewImpl::Repaint(const gfx::Size& size) { |
2740 OnRepaint(size); | 2756 OnRepaint(size); |
2741 } | 2757 } |
2742 | 2758 |
(...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6530 } | 6546 } |
6531 #endif | 6547 #endif |
6532 | 6548 |
6533 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6549 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6534 TransportDIB::Handle dib_handle) { | 6550 TransportDIB::Handle dib_handle) { |
6535 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6551 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6536 RenderProcess::current()->ReleaseTransportDIB(dib); | 6552 RenderProcess::current()->ReleaseTransportDIB(dib); |
6537 } | 6553 } |
6538 | 6554 |
6539 } // namespace content | 6555 } // namespace content |
OLD | NEW |