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

Unified Diff: chrome/browser/plugins/plugin_observer.cc

Issue 2972123002: Click to Open PDF: Open PDF once View PDF is clicked. (Closed)
Patch Set: Rename from download to open PDF Created 3 years, 5 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: chrome/browser/plugins/plugin_observer.cc
diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc
index 6f939ac790ca9b8ad9b3fabee2019b5bf5470162..878d5e17bb96d085ee2729b7a7d1ea6c62d8b002 100644
--- a/chrome/browser/plugins/plugin_observer.cc
+++ b/chrome/browser/plugins/plugin_observer.cc
@@ -267,6 +267,7 @@ bool PluginObserver::OnMessageReceived(
OnShowFlashPermissionBubble)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin,
OnCouldNotLoadPlugin)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenPDF, OnOpenPDF)
IPC_MESSAGE_UNHANDLED(return false)
IPC_END_MESSAGE_MAP()
@@ -335,3 +336,13 @@ void PluginObserver::OnCouldNotLoadPlugin(const base::FilePath& plugin_path) {
plugin_name),
true);
}
+
+void PluginObserver::OnOpenPDF(const GURL& url) {
+ web_contents()->OpenURL(content::OpenURLParams(
+ url,
+ content::Referrer::SanitizeForRequest(
+ url, content::Referrer(web_contents()->GetURL(),
+ blink::kWebReferrerPolicyDefault)),
+ WindowOpenDisposition::NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_AUTO_BOOKMARK, false));
Lei Zhang 2017/07/07 22:47:58 I'm not sure if these are correct, but I also don'
amberwon 2017/07/11 18:08:05 They were used for OnOpenAboutPlugins, when the pl
Lei Zhang 2017/07/12 00:51:37 Well, since the code being referred to was removed
+}

Powered by Google App Engine
This is Rietveld 408576698