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

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: comment 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..4aac22ac70b111b9ac738a4983651d076a86174b
--- /dev/null
+++ b/chrome/renderer/plugins/pdf_plugin_placeholder.h
@@ -0,0 +1,33 @@
+// 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"
+
+// Creates a placeholder that allows users to click to download a PDF for when
Lei Zhang 2017/06/30 19:35:21 nit: The class dosen't create a placeholder. It is
amberwon 2017/06/30 21:59:22 Done.
+// 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 final : public plugins::PluginPlaceholderBase,
+ public gin::Wrappable<PDFPluginPlaceholder> {
+ public:
+ static gin::WrapperInfo kWrapperInfo;
Lei Zhang 2017/06/30 19:35:21 Does this need the const keyword?
amberwon 2017/06/30 21:59:22 No, in the Wrappable class, kWrapperInfo is passed
Lei Zhang 2017/06/30 22:45:11 Ok, I guess this is a weird Gin thing. Let's leave
amberwon 2017/06/30 23:11:12 Acknowledged.
+
+ static PDFPluginPlaceholder* CreatePDFPlaceholder(
Lei Zhang 2017/06/30 19:35:21 Can you add a comment to explain the ownership of
amberwon 2017/06/30 21:59:22 Done.
+ 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;
Lei Zhang 2017/06/30 19:35:21 We usually don't bother marking classes / methods
amberwon 2017/06/30 21:59:22 Done.
Lei Zhang 2017/06/30 22:45:11 So they are now consistent, but how about we make
amberwon 2017/06/30 23:11:12 Done.
+
+ // WebViewPlugin::Delegate methods:
+ v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) final;
+};
+
+#endif // CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_

Powered by Google App Engine
This is Rietveld 408576698