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

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

Issue 116163008: Move the plugin placeholder from CppBoundClass to gin::Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
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/plugin_placeholder.h" 8 #include "components/plugins/renderer/plugin_placeholder.h"
9 #include "gin/wrappable.h"
9 10
10 struct ChromeViewHostMsg_GetPluginInfo_Status; 11 struct ChromeViewHostMsg_GetPluginInfo_Status;
11 12
12 class ChromePluginPlaceholder : public plugins::PluginPlaceholder, 13 class ChromePluginPlaceholder : public plugins::PluginPlaceholder,
13 public content::RenderProcessObserver, 14 public content::RenderProcessObserver,
14 public content::ContextMenuClient { 15 public content::ContextMenuClient,
16 public gin::Wrappable<ChromePluginPlaceholder> {
15 public: 17 public:
18 static gin::WrapperInfo kWrapperInfo;
19 static v8::Local<v8::ObjectTemplate> GetObjectTemplate(v8::Isolate* isolate);
20
16 static const char kPluginPlaceholderDataURL[]; 21 static const char kPluginPlaceholderDataURL[];
17 22
18 static ChromePluginPlaceholder* CreateBlockedPlugin( 23 static ChromePluginPlaceholder* CreateBlockedPlugin(
19 content::RenderFrame* render_frame, 24 content::RenderFrame* render_frame,
20 blink::WebFrame* frame, 25 blink::WebFrame* frame,
21 const blink::WebPluginParams& params, 26 const blink::WebPluginParams& params,
22 const content::WebPluginInfo& info, 27 const content::WebPluginInfo& info,
23 const std::string& identifier, 28 const std::string& identifier,
24 const base::string16& name, 29 const base::string16& name,
25 int resource_id, 30 int resource_id,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 virtual void ShowContextMenu(const blink::WebMouseEvent&) OVERRIDE; 64 virtual void ShowContextMenu(const blink::WebMouseEvent&) OVERRIDE;
60 65
61 // content::RenderProcessObserver methods: 66 // content::RenderProcessObserver methods:
62 virtual void PluginListChanged() OVERRIDE; 67 virtual void PluginListChanged() OVERRIDE;
63 68
64 // content::ContextMenuClient methods: 69 // content::ContextMenuClient methods:
65 virtual void OnMenuAction(int request_id, unsigned action) OVERRIDE; 70 virtual void OnMenuAction(int request_id, unsigned action) OVERRIDE;
66 virtual void OnMenuClosed(int request_id) OVERRIDE; 71 virtual void OnMenuClosed(int request_id) OVERRIDE;
67 72
68 // Javascript callback opens chrome://plugins in a new tab. 73 // Javascript callback opens chrome://plugins in a new tab.
69 // Arguments are required by the caller, but not used. 74 void OpenAboutPluginsCallback();
70 void OpenAboutPluginsCallback(const webkit_glue::CppArgumentList& args,
71 webkit_glue::CppVariant* result);
72 75
73 void OnLoadBlockedPlugins(const std::string& identifier); 76 void OnLoadBlockedPlugins(const std::string& identifier);
74 void OnSetIsPrerendering(bool is_prerendering); 77 void OnSetIsPrerendering(bool is_prerendering);
75 #if defined(ENABLE_PLUGIN_INSTALLATION) 78 #if defined(ENABLE_PLUGIN_INSTALLATION)
76 void OnDidNotFindMissingPlugin(); 79 void OnDidNotFindMissingPlugin();
77 void OnFoundMissingPlugin(const base::string16& plugin_name); 80 void OnFoundMissingPlugin(const base::string16& plugin_name);
78 void OnStartedDownloadingPlugin(); 81 void OnStartedDownloadingPlugin();
79 void OnFinishedDownloadingPlugin(); 82 void OnFinishedDownloadingPlugin();
80 void OnErrorDownloadingPlugin(const std::string& error); 83 void OnErrorDownloadingPlugin(const std::string& error);
81 void OnCancelledDownloadingPlugin(); 84 void OnCancelledDownloadingPlugin();
(...skipping 12 matching lines...) Expand all
94 #endif 97 #endif
95 98
96 bool has_host_; 99 bool has_host_;
97 int context_menu_request_id_; // Nonzero when request pending. 100 int context_menu_request_id_; // Nonzero when request pending.
98 base::string16 plugin_name_; 101 base::string16 plugin_name_;
99 102
100 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); 103 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder);
101 }; 104 };
102 105
103 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ 106 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698