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

Unified Diff: chrome/renderer/plugins/pdf_plugin_placeholder.h

Issue 2961383002: Show a new placeholder for PDF's when plugins are disabled. (Closed)
Patch Set: . Created 3 years, 6 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/renderer/plugins/pdf_plugin_placeholder.h
diff --git a/chrome/renderer/plugins/pdf_plugin_placeholder.h b/chrome/renderer/plugins/pdf_plugin_placeholder.h
new file mode 100644
index 0000000000000000000000000000000000000000..22007eb3fcb08ca007a753a467563b0da9feeaf7
--- /dev/null
+++ b/chrome/renderer/plugins/pdf_plugin_placeholder.h
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_
+#define CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_
+
+#include "components/plugins/renderer/plugin_placeholder.h"
+
+// Placeholder that allows users to click to download a PDF for when
+// plugins are disabled and the PDF fails to load.
+// TODO(amberwon): Flesh out the class more to download an embedded PDF when the
+// PDF plugin is disabled or unavailable.
+class PDFPluginPlaceholder : public plugins::PluginPlaceholderBase,
+ public gin::Wrappable<PDFPluginPlaceholder> {
+ public:
+ static gin::WrapperInfo kWrapperInfo;
+
+ // Returned pointer is owned by plugin, which can be returned by the member
Lei Zhang 2017/06/30 22:45:11 Nobody actually owns the pointer. It's the object
amberwon 2017/06/30 23:11:12 Done.
+ // function plugin().
Lei Zhang 2017/06/30 22:45:11 Except I don't see a plugin() function in this fil
amberwon 2017/06/30 23:11:12 Done.
+ static PDFPluginPlaceholder* CreatePDFPlaceholder(
+ content::RenderFrame* render_frame,
+ const blink::WebPluginParams& params);
+
+ private:
+ PDFPluginPlaceholder(content::RenderFrame* render_frame,
+ const blink::WebPluginParams& params,
+ const std::string& html_data);
+ ~PDFPluginPlaceholder() override;
+
+ // WebViewPlugin::Delegate methods:
+ v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) override;
+};
+
+#endif // CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/plugins/pdf_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698