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 b65256c27f1fce7233363df7a66a376a1daa98d8..b4d95b1bfecad5dd92489d537020e63afcbb2198 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -14,6 +14,7 @@ |
#include "content/browser/web_contents/web_contents_impl.h" |
#include "content/common/browser_plugin_messages.h" |
#include "content/common/view_messages.h" |
+#include "content/public/browser/navigation_entry.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/render_process_host.h" |
@@ -55,6 +56,9 @@ BrowserPluginGuest::BrowserPluginGuest(int instance_id, |
notification_registrar_.Add( |
this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, |
content::Source<content::WebContents>(web_contents)); |
+ notification_registrar_.Add( |
+ this, content::NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED, |
+ content::Source<content::WebContents>(web_contents)); |
} |
BrowserPluginGuest::~BrowserPluginGuest() { |
@@ -89,6 +93,16 @@ void BrowserPluginGuest::Observe(int type, |
is_top_level); |
break; |
} |
+ case NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED: { |
+ DCHECK_EQ(Source<WebContents>(source).ptr(), web_contents()); |
+ std::pair<NavigationEntry*, bool>* title = |
+ Details<std::pair<NavigationEntry*, bool> >(details).ptr(); |
+ if (title->first) { |
+ string16 title_text = title->first->GetTitle(); |
+ TitleChanged(title_text); |
+ } |
+ break; |
+ } |
default: |
NOTREACHED() << "Unexpected notification sent."; |
break; |
@@ -367,6 +381,11 @@ void BrowserPluginGuest::LoadRedirect( |
instance_id(), old_url, new_url, is_top_level)); |
} |
+void BrowserPluginGuest::TitleChanged(const string16& title) { |
+ SendMessageToEmbedder( |
+ new BrowserPluginMsg_TitleChanged(instance_id(), title)); |
+} |
+ |
void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( |
int64 frame_id, |
bool is_main_frame, |