Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 11554030: <webview>: Add name attribute (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added tests Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) 928 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
929 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame) 929 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame)
930 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) 930 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo)
931 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo) 931 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo)
932 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut) 932 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut)
933 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) 933 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy)
934 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste) 934 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste)
935 IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) 935 IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
936 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace) 936 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace)
937 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete) 937 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete)
938 IPC_MESSAGE_HANDLER(ViewMsg_SetName, OnSetName)
938 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) 939 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll)
939 IPC_MESSAGE_HANDLER(ViewMsg_ReplaceAll, OnReplaceAll) 940 IPC_MESSAGE_HANDLER(ViewMsg_ReplaceAll, OnReplaceAll)
940 IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect) 941 IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect)
941 IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets, 942 IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets,
942 OnSetEditableSelectionOffsets) 943 OnSetEditableSelectionOffsets)
943 IPC_MESSAGE_HANDLER(ViewMsg_SetCompositionFromExistingText, 944 IPC_MESSAGE_HANDLER(ViewMsg_SetCompositionFromExistingText,
944 OnSetCompositionFromExistingText) 945 OnSetCompositionFromExistingText)
945 IPC_MESSAGE_HANDLER(ViewMsg_ExtendSelectionAndDelete, 946 IPC_MESSAGE_HANDLER(ViewMsg_ExtendSelectionAndDelete,
946 OnExtendSelectionAndDelete) 947 OnExtendSelectionAndDelete)
947 IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange) 948 IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange)
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 frame->replaceSelection(text); 1343 frame->replaceSelection(text);
1343 } 1344 }
1344 1345
1345 void RenderViewImpl::OnDelete() { 1346 void RenderViewImpl::OnDelete() {
1346 if (!webview()) 1347 if (!webview())
1347 return; 1348 return;
1348 1349
1349 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Delete")); 1350 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Delete"));
1350 } 1351 }
1351 1352
1353 void RenderViewImpl::OnSetName(const std::string& name) {
1354 if (!webview())
1355 return;
1356
1357 webview()->mainFrame()->setName(WebString::fromUTF8(name));
1358 }
1359
1352 void RenderViewImpl::OnSelectAll() { 1360 void RenderViewImpl::OnSelectAll() {
1353 if (!webview()) 1361 if (!webview())
1354 return; 1362 return;
1355 1363
1356 webview()->focusedFrame()->executeCommand( 1364 webview()->focusedFrame()->executeCommand(
1357 WebString::fromUTF8("SelectAll")); 1365 WebString::fromUTF8("SelectAll"));
1358 } 1366 }
1359 1367
1360 void RenderViewImpl::OnReplaceAll(const string16& text) { 1368 void RenderViewImpl::OnReplaceAll(const string16& text) {
1361 WebNode node = GetFocusedNode(); 1369 WebNode node = GetFocusedNode();
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 if (!updating_frame_tree_) 2685 if (!updating_frame_tree_)
2678 SendUpdatedFrameTree(frame); 2686 SendUpdatedFrameTree(frame);
2679 2687
2680 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); 2688 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame));
2681 } 2689 }
2682 2690
2683 void RenderViewImpl::willClose(WebFrame* frame) { 2691 void RenderViewImpl::willClose(WebFrame* frame) {
2684 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); 2692 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame));
2685 } 2693 }
2686 2694
2695 void RenderViewImpl::didChangeName(WebFrame* frame,
2696 const WebString& name) {
2697 Send(new ViewHostMsg_UpdateFrameName(routing_id_,
2698 frame->identifier(),
2699 !frame->parent(),
2700 UTF16ToUTF8(name)));
2701 }
2702
2687 void RenderViewImpl::loadURLExternally( 2703 void RenderViewImpl::loadURLExternally(
2688 WebFrame* frame, const WebURLRequest& request, 2704 WebFrame* frame, const WebURLRequest& request,
2689 WebNavigationPolicy policy) { 2705 WebNavigationPolicy policy) {
2690 loadURLExternally(frame, request, policy, WebString()); 2706 loadURLExternally(frame, request, policy, WebString());
2691 } 2707 }
2692 2708
2693 void RenderViewImpl::Repaint(const gfx::Size& size) { 2709 void RenderViewImpl::Repaint(const gfx::Size& size) {
2694 OnMsgRepaint(size); 2710 OnMsgRepaint(size);
2695 } 2711 }
2696 2712
(...skipping 3784 matching lines...) Expand 10 before | Expand all | Expand 10 after
6481 } 6497 }
6482 #endif 6498 #endif
6483 6499
6484 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6500 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6485 TransportDIB::Handle dib_handle) { 6501 TransportDIB::Handle dib_handle) {
6486 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6502 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6487 RenderProcess::current()->ReleaseTransportDIB(dib); 6503 RenderProcess::current()->ReleaseTransportDIB(dib);
6488 } 6504 }
6489 6505
6490 } // namespace content 6506 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698