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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 13467038: Browser Plugin: Expose frame name changes to the content API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Expose RenderViewHost::SetName to the content API Created 7 years, 8 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
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 3248afdfb54b856da8d5e4bdc2dd847938571b1b..df6f623e5290b30f540d147c80be6f396aa05882 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -606,6 +606,17 @@ void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) {
SendMessageToEmbedder(new BrowserPluginMsg_LoadStop(instance_id()));
}
+void BrowserPluginGuest::DidUpdateFrameName(int frame_id,
+ bool is_top_level,
+ const std::string& name,
+ RenderViewHost* render_view_host) {
+ if (!is_top_level)
+ return;
+
+ name_ = name;
+ SendMessageToEmbedder(new BrowserPluginMsg_UpdatedName(instance_id_, name));
+}
+
void BrowserPluginGuest::RenderViewReady() {
// TODO(fsamuel): Investigate whether it's possible to update state earlier
// here (see http://crbug.com/158151).
@@ -617,7 +628,7 @@ void BrowserPluginGuest::RenderViewReady() {
else
rvh->DisableAutoResize(damage_view_size_);
- Send(new ViewMsg_SetName(routing_id(), name_));
+ rvh->SetName(name_);
jam 2013/04/09 16:11:51 is the intent that this file will move out content
RenderWidgetHostImpl::From(rvh)->
set_hung_renderer_delay_ms(guest_hang_timeout_);
@@ -703,7 +714,6 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse)
IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
- IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFrameName, OnUpdateFrameName)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -942,7 +952,7 @@ void BrowserPluginGuest::OnSetName(int instance_id, const std::string& name) {
if (name == name_)
return;
name_ = name;
- Send(new ViewMsg_SetName(routing_id(), name));
+ GetWebContents()->GetRenderViewHost()->SetName(name_);
}
void BrowserPluginGuest::OnSetSize(
@@ -1107,16 +1117,6 @@ void BrowserPluginGuest::OnUpdateDragCursor(
view->UpdateDragCursor(operation);
}
-void BrowserPluginGuest::OnUpdateFrameName(int frame_id,
- bool is_top_level,
- const std::string& name) {
- if (!is_top_level)
- return;
-
- name_ = name;
- SendMessageToEmbedder(new BrowserPluginMsg_UpdatedName(instance_id_, name));
-}
-
void BrowserPluginGuest::RequestMediaAccessPermission(
WebContents* web_contents,
const MediaStreamRequest& request,

Powered by Google App Engine
This is Rietveld 408576698