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

Side by Side Diff: chrome/renderer/blocked_plugin.h

Issue 8461011: Clean up plug-in placeholders: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 1 month 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/renderer/blocked_plugin.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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_BLOCKED_PLUGIN_H_
6 #define CHROME_RENDERER_BLOCKED_PLUGIN_H_
7 #pragma once
8
9 #include "content/public/renderer/render_view_observer.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
11 #include "webkit/glue/cpp_bound_class.h"
12 #include "webkit/plugins/npapi/webview_plugin.h"
13 #include "webkit/plugins/webplugininfo.h"
14
15 class BlockedPlugin : public content::RenderViewObserver,
16 public CppBoundClass,
17 public webkit::npapi::WebViewPlugin::Delegate {
18 public:
19 BlockedPlugin(content::RenderView* render_view,
20 WebKit::WebFrame* frame,
21 const webkit::WebPluginInfo& info,
22 const WebKit::WebPluginParams& params,
23 const WebPreferences& settings,
24 int template_id,
25 const string16& name,
26 const string16& message,
27 bool is_blocked_for_prerendering,
28 bool allow_loading);
29
30 webkit::npapi::WebViewPlugin* plugin() { return plugin_; }
31
32 // WebViewPlugin::Delegate methods:
33 virtual void BindWebFrame(WebKit::WebFrame* frame) OVERRIDE;
34 virtual void WillDestroyPlugin() OVERRIDE;
35 virtual void ShowContextMenu(const WebKit::WebMouseEvent&) OVERRIDE;
36
37 private:
38 virtual ~BlockedPlugin();
39
40 // RenderViewObserver methods:
41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
42 virtual void ContextMenuAction(unsigned id) OVERRIDE;
43
44 void OnLoadBlockedPlugins();
45 void OnSetIsPrerendering(bool is_prerendering);
46
47 // Javascript callbacks:
48 // Load the blocked plugin by calling LoadPlugin().
49 // Takes no arguments, and returns nothing.
50 void LoadCallback(const CppArgumentList& args, CppVariant* result);
51
52 // Hide the blocked plugin by calling HidePlugin().
53 // Takes no arguments, and returns nothing.
54 void HideCallback(const CppArgumentList& args, CppVariant* result);
55
56 // Opens a URL in a new tab.
57 // Takes one argument, a string specifying the URL to open. Returns nothing.
58 void OpenUrlCallback(const CppArgumentList& args, CppVariant* result);
59
60 // Load the blocked plugin.
61 void LoadPlugin();
62
63 // Hide the blocked plugin.
64 void HidePlugin();
65
66 WebKit::WebFrame* frame_;
67 webkit::WebPluginInfo plugin_info_;
68 WebKit::WebPluginParams plugin_params_;
69 webkit::npapi::WebViewPlugin* plugin_;
70 // The name of the plugin that was blocked.
71 string16 name_;
72 // True iff the plugin was blocked because the page was being prerendered.
73 // Plugin will automatically be loaded when the page is displayed.
74 bool is_blocked_for_prerendering_;
75 bool hidden_;
76 bool allow_loading_;
77 };
78
79 #endif // CHROME_RENDERER_BLOCKED_PLUGIN_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/renderer/blocked_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698