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

Side by Side Diff: components/plugins/renderer/mobile_youtube_plugin.h

Issue 116163008: Move the plugin placeholder from CppBoundClass to gin::Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « components/plugins/renderer/DEPS ('k') | components/plugins/renderer/mobile_youtube_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
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 COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_ 5 #ifndef COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_
6 #define COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_ 6 #define COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_
7 7
8 #include "components/plugins/renderer/plugin_placeholder.h" 8 #include "components/plugins/renderer/plugin_placeholder.h"
9 9
10 namespace plugins { 10 namespace plugins {
11 11
12 // Class representing placeholders for old style embedded youtube video on 12 // Class representing placeholders for old style embedded youtube video on
13 // mobile device. For old style embedded youtube video, it has a url in the form 13 // mobile device. For old style embedded youtube video, it has a url in the form
14 // of http://www.youtube.com/v/VIDEO_ID. This placeholder replaces the url with 14 // of http://www.youtube.com/v/VIDEO_ID. This placeholder replaces the url with
15 // a simple html page and clicking the play image redirects the user to the 15 // a simple html page and clicking the play image redirects the user to the
16 // mobile youtube app. 16 // mobile youtube app.
17 class MobileYouTubePlugin : public PluginPlaceholder { 17 class MobileYouTubePlugin : public PluginPlaceholder {
18 public: 18 public:
19 MobileYouTubePlugin(content::RenderFrame* render_frame, 19 MobileYouTubePlugin(content::RenderFrame* render_frame,
20 blink::WebFrame* frame, 20 blink::WebFrame* frame,
21 const blink::WebPluginParams& params, 21 const blink::WebPluginParams& params,
22 base::StringPiece& template_html, 22 base::StringPiece& template_html,
23 GURL placeholderDataUrl); 23 GURL placeholderDataUrl);
24 24
25 // Whether this is a youtube url. 25 // Whether this is a youtube url.
26 static bool IsYouTubeURL(const GURL& url, const std::string& mime_type); 26 static bool IsYouTubeURL(const GURL& url, const std::string& mime_type);
27 27
28 private: 28 private:
29 virtual ~MobileYouTubePlugin();
30
29 // Opens a youtube app in the current tab. 31 // Opens a youtube app in the current tab.
30 void OpenYoutubeUrlCallback(const webkit_glue::CppArgumentList& args, 32 void OpenYoutubeUrlCallback();
31 webkit_glue::CppVariant* result);
32 33
33 // WebViewPlugin::Delegate (via PluginPlaceholder) method 34 // WebViewPlugin::Delegate (via PluginPlaceholder) method
34 virtual void BindWebFrame(blink::WebFrame* frame) OVERRIDE; 35 virtual void BindWebFrame(blink::WebFrame* frame) OVERRIDE;
35 36
37 // gin::Wrappable (via PluginPlaceholder) method
38 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
39 v8::Isolate* isolate) OVERRIDE;
40
36 DISALLOW_COPY_AND_ASSIGN(MobileYouTubePlugin); 41 DISALLOW_COPY_AND_ASSIGN(MobileYouTubePlugin);
37 }; 42 };
38 43
39 } // namespace plugins 44 } // namespace plugins
40 45
41 #endif // COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_ 46 #endif // COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_
OLDNEW
« no previous file with comments | « components/plugins/renderer/DEPS ('k') | components/plugins/renderer/mobile_youtube_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698