Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_ | |
| 6 #define CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_ | |
| 7 | |
| 8 #include "components/plugins/renderer/plugin_placeholder.h" | |
| 9 | |
| 10 // 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.
| |
| 11 // plugins are disabled and the PDF fails to load. | |
| 12 // TODO(amberwon): Flesh out the class more to download an embedded PDF when the | |
| 13 // PDF plugin is disabled or unavailable. | |
| 14 class PDFPluginPlaceholder final : public plugins::PluginPlaceholderBase, | |
| 15 public gin::Wrappable<PDFPluginPlaceholder> { | |
| 16 public: | |
| 17 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.
| |
| 18 | |
| 19 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.
| |
| 20 content::RenderFrame* render_frame, | |
| 21 const blink::WebPluginParams& params); | |
| 22 | |
| 23 private: | |
| 24 PDFPluginPlaceholder(content::RenderFrame* render_frame, | |
| 25 const blink::WebPluginParams& params, | |
| 26 const std::string& html_data); | |
| 27 ~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.
| |
| 28 | |
| 29 // WebViewPlugin::Delegate methods: | |
| 30 v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) final; | |
| 31 }; | |
| 32 | |
| 33 #endif // CHROME_RENDERER_PLUGINS_PDF_PLUGIN_PLACEHOLDER_H_ | |
| OLD | NEW |