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

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: Merged with ToT and back to plumbing directly to BrowserPlugin instead of through WebContents Created 7 years, 11 months 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) 933 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
934 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame) 934 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame)
935 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) 935 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo)
936 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo) 936 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo)
937 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut) 937 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut)
938 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) 938 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy)
939 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste) 939 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste)
940 IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle) 940 IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
941 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace) 941 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace)
942 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete) 942 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete)
943 IPC_MESSAGE_HANDLER(ViewMsg_SetName, OnSetName)
943 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) 944 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll)
944 IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect) 945 IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect)
945 IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets, 946 IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets,
946 OnSetEditableSelectionOffsets) 947 OnSetEditableSelectionOffsets)
947 IPC_MESSAGE_HANDLER(ViewMsg_SetCompositionFromExistingText, 948 IPC_MESSAGE_HANDLER(ViewMsg_SetCompositionFromExistingText,
948 OnSetCompositionFromExistingText) 949 OnSetCompositionFromExistingText)
949 IPC_MESSAGE_HANDLER(ViewMsg_ExtendSelectionAndDelete, 950 IPC_MESSAGE_HANDLER(ViewMsg_ExtendSelectionAndDelete,
950 OnExtendSelectionAndDelete) 951 OnExtendSelectionAndDelete)
951 IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange) 952 IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange)
952 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) 953 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt)
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 frame->replaceSelection(text); 1356 frame->replaceSelection(text);
1356 } 1357 }
1357 1358
1358 void RenderViewImpl::OnDelete() { 1359 void RenderViewImpl::OnDelete() {
1359 if (!webview()) 1360 if (!webview())
1360 return; 1361 return;
1361 1362
1362 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Delete")); 1363 webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Delete"));
1363 } 1364 }
1364 1365
1366 void RenderViewImpl::OnSetName(const std::string& name) {
1367 if (!webview())
1368 return;
1369
1370 webview()->mainFrame()->setName(WebString::fromUTF8(name));
1371 }
1372
1365 void RenderViewImpl::OnSelectAll() { 1373 void RenderViewImpl::OnSelectAll() {
1366 if (!webview()) 1374 if (!webview())
1367 return; 1375 return;
1368 1376
1369 webview()->focusedFrame()->executeCommand( 1377 webview()->focusedFrame()->executeCommand(
1370 WebString::fromUTF8("SelectAll")); 1378 WebString::fromUTF8("SelectAll"));
1371 } 1379 }
1372 1380
1373 void RenderViewImpl::OnUnselect() { 1381 void RenderViewImpl::OnUnselect() {
1374 if (!webview()) 1382 if (!webview())
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 if (!updating_frame_tree_) 2713 if (!updating_frame_tree_)
2706 SendUpdatedFrameTree(frame); 2714 SendUpdatedFrameTree(frame);
2707 2715
2708 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); 2716 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame));
2709 } 2717 }
2710 2718
2711 void RenderViewImpl::willClose(WebFrame* frame) { 2719 void RenderViewImpl::willClose(WebFrame* frame) {
2712 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); 2720 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame));
2713 } 2721 }
2714 2722
2723 void RenderViewImpl::didChangeName(WebFrame* frame,
2724 const WebString& name) {
2725 Send(new ViewHostMsg_UpdateFrameName(routing_id_,
2726 frame->identifier(),
2727 !frame->parent(),
2728 UTF16ToUTF8(name)));
Charlie Reis 2013/01/04 21:36:33 Just checking: are we ok with this conversion? I'
Fady Samuel 2013/01/08 16:19:07 Judging by this: http://www.w3.org/TR/html4/presen
Charlie Reis 2013/01/08 21:18:45 Great! Thanks for verifying.
2729 }
2730
2715 void RenderViewImpl::loadURLExternally( 2731 void RenderViewImpl::loadURLExternally(
2716 WebFrame* frame, const WebURLRequest& request, 2732 WebFrame* frame, const WebURLRequest& request,
2717 WebNavigationPolicy policy) { 2733 WebNavigationPolicy policy) {
2718 loadURLExternally(frame, request, policy, WebString()); 2734 loadURLExternally(frame, request, policy, WebString());
2719 } 2735 }
2720 2736
2721 void RenderViewImpl::Repaint(const gfx::Size& size) { 2737 void RenderViewImpl::Repaint(const gfx::Size& size) {
2722 OnMsgRepaint(size); 2738 OnMsgRepaint(size);
2723 } 2739 }
2724 2740
(...skipping 3788 matching lines...) Expand 10 before | Expand all | Expand 10 after
6513 } 6529 }
6514 #endif 6530 #endif
6515 6531
6516 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6532 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6517 TransportDIB::Handle dib_handle) { 6533 TransportDIB::Handle dib_handle) {
6518 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6534 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6519 RenderProcess::current()->ReleaseTransportDIB(dib); 6535 RenderProcess::current()->ReleaseTransportDIB(dib);
6520 } 6536 }
6521 6537
6522 } // namespace content 6538 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698