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

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

Issue 23606022: Move renderer plugin code into a new component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move renderer plugin code into a new component - put back wrongly deleted DEPS file Created 7 years, 3 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
Jói 2013/09/09 17:46:17 This file and the next seem to be modifications/ex
aberent 2013/09/10 13:24:01 I think 50 is the default. I will try lowering it
Bernhard Bauer 2013/09/10 13:47:10 FTR, you can delete individual patch sets, so it's
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_CHROME_PLUGIN_PLACEHOLDER_H_
6 #define CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_
7
8 #include "components/plugins/renderer/plugin_placeholder.h"
9
10 struct ChromeViewHostMsg_GetPluginInfo_Status;
11
12 class ChromePluginPlaceholder : public PluginPlaceholder,
13 public content::RenderProcessObserver,
14 public content::ContextMenuClient {
15 public:
16 ChromePluginPlaceholder(content::RenderView* render_view,
Bernhard Bauer 2013/09/09 17:28:07 Do we ever directly construct this object outside
aberent 2013/09/10 13:24:01 Done.
17 WebKit::WebFrame* frame,
18 const WebKit::WebPluginParams& params,
19 const std::string& html_data,
20 const string16& title);
21 virtual ~ChromePluginPlaceholder();
22
23 static ChromePluginPlaceholder* CreateBlockedPlugin(
24 content::RenderView* render_view,
25 WebKit::WebFrame* frame,
26 const WebKit::WebPluginParams& params,
27 const content::WebPluginInfo& info,
28 const std::string& identifier,
29 const string16& name,
30 int resource_id,
31 const string16& message);
32
33 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN)
34 // Placeholder for old style embedded youtube video on mobile device. For old
35 // style embedded youtube video, it has a url in the form of
36 // http://www.youtube.com/v/VIDEO_ID. This placeholder replaces the url with a
37 // simple html page and clicking the play image redirects the user to the
38 // mobile youtube app.
39 static ChromePluginPlaceholder* CreateMobileYoutubePlugin(
40 content::RenderView* render_view,
41 WebKit::WebFrame* frame,
42 const WebKit::WebPluginParams& params);
43 #endif
44
45 // Creates a new WebViewPlugin with a MissingPlugin as a delegate.
46 static ChromePluginPlaceholder* CreateMissingPlugin(
47 content::RenderView* render_view,
48 WebKit::WebFrame* frame,
49 const WebKit::WebPluginParams& params);
50
51 static ChromePluginPlaceholder* CreateErrorPlugin(
52 content::RenderView* render_view,
53 const base::FilePath& plugin_path);
54
55 void SetStatus(const ChromeViewHostMsg_GetPluginInfo_Status& status);
56
57 #if defined(ENABLE_PLUGIN_INSTALLATION)
58 int32 CreateRoutingId();
59 #endif
60
61 private:
62 // content::RenderViewObserver (via PluginPlaceholder) override:
63 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
64
65 // WebViewPlugin::Delegate (via PluginPlaceholder) methods:
66 virtual void ShowContextMenu(const WebKit::WebMouseEvent&) OVERRIDE;
67
68 // content::RenderProcessObserver methods:
69 virtual void PluginListChanged() OVERRIDE;
70
71 // content::ContextMenuClient methods:
72 virtual void OnMenuAction(int request_id, unsigned action) OVERRIDE;
73 virtual void OnMenuClosed(int request_id) OVERRIDE;
74 virtual void OpenAboutPlugins() OVERRIDE;
75
76 // Local methods:
Bernhard Bauer 2013/09/09 17:28:07 Super-nit: For blocks of virtual methods it makes
aberent 2013/09/10 13:24:01 Done.
77 void OnLoadBlockedPlugins(const std::string& identifier);
78 void OnSetIsPrerendering(bool is_prerendering);
79 #if defined(ENABLE_PLUGIN_INSTALLATION)
80 void OnDidNotFindMissingPlugin();
81 void OnFoundMissingPlugin(const string16& plugin_name);
82 void OnStartedDownloadingPlugin();
83 void OnFinishedDownloadingPlugin();
84 void OnErrorDownloadingPlugin(const std::string& error);
85 void OnCancelledDownloadingPlugin();
86 #endif
87
88 // We use a scoped_ptr so we can forward-declare the struct; it's defined in
89 // an IPC message file which can't be easily included in other header files.
90 scoped_ptr<ChromeViewHostMsg_GetPluginInfo_Status> status_;
91
92 string16 title_;
93
94 #if defined(ENABLE_PLUGIN_INSTALLATION)
95 // |routing_id()| is the routing ID of our associated RenderView, but we have
96 // a separate routing ID for messages specific to this placeholder.
97 int32 placeholder_routing_id_;
98 #endif
99
100 bool has_host_;
101 int context_menu_request_id_; // Nonzero when request pending.
102 string16 plugin_name_;
103
104 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder);
105 };
106
107 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698