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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/plugins/chrome_plugin_placeholder.h
diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.h b/chrome/renderer/plugins/chrome_plugin_placeholder.h
new file mode 100644
index 0000000000000000000000000000000000000000..268788738c2a065adbb5744dca5fb3ee3abea5eb
--- /dev/null
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.h
@@ -0,0 +1,107 @@
+// 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
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_
+#define CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_
+
+#include "components/plugins/renderer/plugin_placeholder.h"
+
+struct ChromeViewHostMsg_GetPluginInfo_Status;
+
+class ChromePluginPlaceholder : public PluginPlaceholder,
+ public content::RenderProcessObserver,
+ public content::ContextMenuClient {
+ public:
+ 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.
+ WebKit::WebFrame* frame,
+ const WebKit::WebPluginParams& params,
+ const std::string& html_data,
+ const string16& title);
+ virtual ~ChromePluginPlaceholder();
+
+ static ChromePluginPlaceholder* CreateBlockedPlugin(
+ content::RenderView* render_view,
+ WebKit::WebFrame* frame,
+ const WebKit::WebPluginParams& params,
+ const content::WebPluginInfo& info,
+ const std::string& identifier,
+ const string16& name,
+ int resource_id,
+ const string16& message);
+
+#if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN)
+ // Placeholder for old style embedded youtube video on mobile device. For old
+ // style embedded youtube video, it has a url in the form of
+ // http://www.youtube.com/v/VIDEO_ID. This placeholder replaces the url with a
+ // simple html page and clicking the play image redirects the user to the
+ // mobile youtube app.
+ static ChromePluginPlaceholder* CreateMobileYoutubePlugin(
+ content::RenderView* render_view,
+ WebKit::WebFrame* frame,
+ const WebKit::WebPluginParams& params);
+#endif
+
+ // Creates a new WebViewPlugin with a MissingPlugin as a delegate.
+ static ChromePluginPlaceholder* CreateMissingPlugin(
+ content::RenderView* render_view,
+ WebKit::WebFrame* frame,
+ const WebKit::WebPluginParams& params);
+
+ static ChromePluginPlaceholder* CreateErrorPlugin(
+ content::RenderView* render_view,
+ const base::FilePath& plugin_path);
+
+ void SetStatus(const ChromeViewHostMsg_GetPluginInfo_Status& status);
+
+#if defined(ENABLE_PLUGIN_INSTALLATION)
+ int32 CreateRoutingId();
+#endif
+
+ private:
+ // content::RenderViewObserver (via PluginPlaceholder) override:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // WebViewPlugin::Delegate (via PluginPlaceholder) methods:
+ virtual void ShowContextMenu(const WebKit::WebMouseEvent&) OVERRIDE;
+
+ // content::RenderProcessObserver methods:
+ virtual void PluginListChanged() OVERRIDE;
+
+ // content::ContextMenuClient methods:
+ virtual void OnMenuAction(int request_id, unsigned action) OVERRIDE;
+ virtual void OnMenuClosed(int request_id) OVERRIDE;
+ virtual void OpenAboutPlugins() OVERRIDE;
+
+ // 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.
+ void OnLoadBlockedPlugins(const std::string& identifier);
+ void OnSetIsPrerendering(bool is_prerendering);
+#if defined(ENABLE_PLUGIN_INSTALLATION)
+ void OnDidNotFindMissingPlugin();
+ void OnFoundMissingPlugin(const string16& plugin_name);
+ void OnStartedDownloadingPlugin();
+ void OnFinishedDownloadingPlugin();
+ void OnErrorDownloadingPlugin(const std::string& error);
+ void OnCancelledDownloadingPlugin();
+#endif
+
+ // We use a scoped_ptr so we can forward-declare the struct; it's defined in
+ // an IPC message file which can't be easily included in other header files.
+ scoped_ptr<ChromeViewHostMsg_GetPluginInfo_Status> status_;
+
+ string16 title_;
+
+#if defined(ENABLE_PLUGIN_INSTALLATION)
+ // |routing_id()| is the routing ID of our associated RenderView, but we have
+ // a separate routing ID for messages specific to this placeholder.
+ int32 placeholder_routing_id_;
+#endif
+
+ bool has_host_;
+ int context_menu_request_id_; // Nonzero when request pending.
+ string16 plugin_name_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder);
+};
+
+#endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_

Powered by Google App Engine
This is Rietveld 408576698