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

Side by Side Diff: chrome/renderer/plugins/chrome_plugin_placeholder.h

Issue 1161923004: Reland: Plugin Placeholders: Refactor for platforms that don't support plugins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A versio that removes gin Wrappable subclassing Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ 5 #ifndef CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_
6 #define CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ 6 #define CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_
7 7
8 #include "components/plugins/renderer/loadable_plugin_placeholder.h" 8 #include "components/plugins/renderer/loadable_plugin_placeholder.h"
9 #include "content/public/renderer/context_menu_client.h" 9 #include "content/public/renderer/context_menu_client.h"
10 #include "content/public/renderer/render_process_observer.h" 10 #include "content/public/renderer/render_process_observer.h"
(...skipping 10 matching lines...) Expand all
21 // The poster image specified in image 'srcset' attribute format. 21 // The poster image specified in image 'srcset' attribute format.
22 std::string poster_attribute; 22 std::string poster_attribute;
23 23
24 // Used to resolve relative paths in |poster_attribute|. 24 // Used to resolve relative paths in |poster_attribute|.
25 GURL base_url; 25 GURL base_url;
26 26
27 // Specify this to provide partially obscured plugins a centered poster image. 27 // Specify this to provide partially obscured plugins a centered poster image.
28 gfx::Size custom_poster_size; 28 gfx::Size custom_poster_size;
29 }; 29 };
30 30
31 class ChromePluginPlaceholder : public plugins::LoadablePluginPlaceholder, 31 class ChromePluginPlaceholder final
32 public content::RenderProcessObserver, 32 : public plugins::LoadablePluginPlaceholder,
33 public content::ContextMenuClient { 33 public content::RenderProcessObserver,
34 public content::ContextMenuClient,
35 public gin::Wrappable<ChromePluginPlaceholder> {
34 public: 36 public:
35 static const char kPluginPlaceholderDataURL[]; 37 static gin::WrapperInfo kWrapperInfo;
36 38
37 static ChromePluginPlaceholder* CreateBlockedPlugin( 39 static ChromePluginPlaceholder* CreateBlockedPlugin(
38 content::RenderFrame* render_frame, 40 content::RenderFrame* render_frame,
39 blink::WebLocalFrame* frame, 41 blink::WebLocalFrame* frame,
40 const blink::WebPluginParams& params, 42 const blink::WebPluginParams& params,
41 const content::WebPluginInfo& info, 43 const content::WebPluginInfo& info,
42 const std::string& identifier, 44 const std::string& identifier,
43 const base::string16& name, 45 const base::string16& name,
44 int resource_id, 46 int resource_id,
45 const base::string16& message, 47 const base::string16& message,
46 const PlaceholderPosterInfo& poster_info); 48 const PlaceholderPosterInfo& poster_info);
47 49
48 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. 50 // Creates a new WebViewPlugin with a MissingPlugin as a delegate.
49 static ChromePluginPlaceholder* CreateMissingPlugin( 51 static ChromePluginPlaceholder* CreateLoadableMissingPlugin(
50 content::RenderFrame* render_frame, 52 content::RenderFrame* render_frame,
51 blink::WebLocalFrame* frame, 53 blink::WebLocalFrame* frame,
52 const blink::WebPluginParams& params); 54 const blink::WebPluginParams& params);
53 55
54 static ChromePluginPlaceholder* CreateErrorPlugin(
55 content::RenderFrame* render_frame,
56 const base::FilePath& plugin_path);
57
58 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status); 56 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status);
59 57
60 #if defined(ENABLE_PLUGIN_INSTALLATION) 58 #if defined(ENABLE_PLUGIN_INSTALLATION)
61 int32 CreateRoutingId(); 59 int32 CreateRoutingId();
62 #endif 60 #endif
63 61
64 private: 62 private:
65 ChromePluginPlaceholder(content::RenderFrame* render_frame, 63 ChromePluginPlaceholder(content::RenderFrame* render_frame,
66 blink::WebLocalFrame* frame, 64 blink::WebLocalFrame* frame,
67 const blink::WebPluginParams& params, 65 const blink::WebPluginParams& params,
68 const std::string& html_data, 66 const std::string& html_data,
69 const base::string16& title); 67 const base::string16& title);
70 ~ChromePluginPlaceholder() override; 68 ~ChromePluginPlaceholder() override;
71 69
72 // content::LoadablePluginPlaceholder method 70 // content::LoadablePluginPlaceholder method
73 blink::WebPlugin* CreatePlugin() override; 71 blink::WebPlugin* CreatePlugin() override;
74 72
75 // gin::Wrappable (via PluginPlaceholder) method 73 // gin::Wrappable (via PluginPlaceholder) method
76 gin::ObjectTemplateBuilder GetObjectTemplateBuilder( 74 gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
77 v8::Isolate* isolate) override; 75 v8::Isolate* isolate) final;
Bernhard Bauer 2015/06/11 17:43:02 Does final imply override?
tommycli 2015/06/11 17:46:45 Yes, final implies override. In fact clang-style d
78 76
79 // content::RenderViewObserver (via PluginPlaceholder) override: 77 // content::RenderViewObserver (via PluginPlaceholder) override:
80 bool OnMessageReceived(const IPC::Message& message) override; 78 bool OnMessageReceived(const IPC::Message& message) override;
81 79
82 // WebViewPlugin::Delegate (via PluginPlaceholder) methods: 80 // WebViewPlugin::Delegate (via PluginPlaceholder) methods:
81 v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) override;
83 void ShowContextMenu(const blink::WebMouseEvent&) override; 82 void ShowContextMenu(const blink::WebMouseEvent&) override;
84 83
85 // content::RenderProcessObserver methods: 84 // content::RenderProcessObserver methods:
86 void PluginListChanged() override; 85 void PluginListChanged() override;
87 86
88 // content::ContextMenuClient methods: 87 // content::ContextMenuClient methods:
89 void OnMenuAction(int request_id, unsigned action) override; 88 void OnMenuAction(int request_id, unsigned action) override;
90 void OnMenuClosed(int request_id) override; 89 void OnMenuClosed(int request_id) override;
91 90
92 // Javascript callbacks: 91 // Javascript callbacks:
(...skipping 21 matching lines...) Expand all
114 #endif 113 #endif
115 114
116 bool has_host_; 115 bool has_host_;
117 int context_menu_request_id_; // Nonzero when request pending. 116 int context_menu_request_id_; // Nonzero when request pending.
118 base::string16 plugin_name_; 117 base::string16 plugin_name_;
119 118
120 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); 119 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder);
121 }; 120 };
122 121
123 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ 122 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/plugins/chrome_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698