summaryrefslogtreecommitdiffstats
path: root/extensions/browser/guest_view
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2015-10-27 12:22:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-27 19:23:30 +0000
commitcba601c814e1e390e31dfb053efb09e070541283 (patch)
treeab869eb19e3d7dfa0b7a883ea220984de3502029 /extensions/browser/guest_view
parent5e1e1010cbe73b244025c5c21eeb1970472b4612 (diff)
downloadchromium_src-cba601c814e1e390e31dfb053efb09e070541283.zip
chromium_src-cba601c814e1e390e31dfb053efb09e070541283.tar.gz
chromium_src-cba601c814e1e390e31dfb053efb09e070541283.tar.bz2
Add MimeHandlerViewGuest::NavigationStateChanged to handle title changes
and propagate them upwards to the embedder. BUG=47914 Review URL: https://codereview.chromium.org/1412073002 Cr-Commit-Position: refs/heads/master@{#356366}
Diffstat (limited to 'extensions/browser/guest_view')
-rw-r--r--extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc19
-rw-r--r--extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index aee7d72..55b2426 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -8,6 +8,7 @@
#include "components/guest_view/common/guest_view_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/host_zoom_map.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/stream_handle.h"
#include "content/public/browser/stream_info.h"
@@ -162,6 +163,24 @@ WebContents* MimeHandlerViewGuest::OpenURLFromTab(
embedder_web_contents(), params);
}
+void MimeHandlerViewGuest::NavigationStateChanged(
+ WebContents* source,
+ content::InvalidateTypes changed_flags) {
+ if (!(changed_flags & content::INVALIDATE_TYPE_TITLE))
+ return;
+
+ if (!is_full_page_plugin())
+ return;
+
+ content::NavigationEntry* last_committed_entry =
+ embedder_web_contents()->GetController().GetLastCommittedEntry();
+ if (last_committed_entry) {
+ last_committed_entry->SetTitle(source->GetTitle());
+ embedder_web_contents()->GetDelegate()->NavigationStateChanged(
+ embedder_web_contents(), changed_flags);
+ }
+}
+
bool MimeHandlerViewGuest::HandleContextMenu(
const content::ContextMenuParams& params) {
if (delegate_)
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
index d482430..a876f6a 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
@@ -78,6 +78,8 @@ class MimeHandlerViewGuest :
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) final;
+ void NavigationStateChanged(content::WebContents* source,
+ content::InvalidateTypes changed_flags) final;
bool HandleContextMenu(const content::ContextMenuParams& params) final;
bool PreHandleGestureEvent(content::WebContents* source,
const blink::WebGestureEvent& event) final;