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

Unified 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 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/data/browser_plugin_naming_embedder.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 1dcfe80060b6ee487deef89bd6e5cc907800f806..c0f21d3f36103ce4825088561709303e7c486339 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -964,6 +964,7 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_PasteAndMatchStyle, OnPasteAndMatchStyle)
IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace)
IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetName, OnSetName)
IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll)
IPC_MESSAGE_HANDLER(ViewMsg_Unselect, OnUnselect)
IPC_MESSAGE_HANDLER(ViewMsg_SetEditableSelectionOffsets,
@@ -1386,6 +1387,13 @@ void RenderViewImpl::OnDelete() {
webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Delete"));
}
+void RenderViewImpl::OnSetName(const std::string& name) {
+ if (!webview())
+ return;
+
+ webview()->mainFrame()->setName(WebString::fromUTF8(name));
+}
+
void RenderViewImpl::OnSelectAll() {
if (!webview())
return;
@@ -2730,6 +2738,14 @@ void RenderViewImpl::willClose(WebFrame* frame) {
FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame));
}
+void RenderViewImpl::didChangeName(WebFrame* frame,
+ const WebString& name) {
+ Send(new ViewHostMsg_UpdateFrameName(routing_id_,
+ frame->identifier(),
+ !frame->parent(),
+ UTF16ToUTF8(name)));
+}
+
void RenderViewImpl::loadURLExternally(
WebFrame* frame, const WebURLRequest& request,
WebNavigationPolicy policy) {
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/data/browser_plugin_naming_embedder.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698