Chromium Code Reviews| Index: components/plugins/renderer/mobile_youtube_plugin.h |
| diff --git a/components/plugins/renderer/mobile_youtube_plugin.h b/components/plugins/renderer/mobile_youtube_plugin.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cbbc1efa67061c018594f022f4fedabfd482b7a0 |
| --- /dev/null |
| +++ b/components/plugins/renderer/mobile_youtube_plugin.h |
| @@ -0,0 +1,37 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_ |
| +#define COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_ |
| + |
| +#include "components/plugins/renderer/plugin_placeholder.h" |
| + |
| +// Class representing placeholders 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. |
| +class MobileYouTubePlugin : public PluginPlaceholder { |
| + public: |
| + MobileYouTubePlugin(content::RenderView* render_view, |
| + WebKit::WebFrame* frame, |
| + const WebKit::WebPluginParams& params, |
| + base::StringPiece& template_html); |
| + |
| + // Whether this is a youtube url. |
| + static bool IsYouTubeURL(const GURL& url, const std::string& mime_type); |
| + |
| + private: |
| + |
|
Bernhard Bauer
2013/09/10 13:47:10
Nit: no empty line after public/protected/private
aberent
2013/09/13 19:46:22
Done.
|
| + // Opens a youtube app in the current tab. |
| + void OpenYoutubeUrlCallback(const webkit_glue::CppArgumentList& args, |
| + webkit_glue::CppVariant* result); |
| + |
| + // WebViewPlugin::Delegate (via PluginPlaceholder) method |
| + virtual void BindWebFrame(WebKit::WebFrame* frame) OVERRIDE; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MobileYouTubePlugin); |
| +}; |
| + |
| +#endif // COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_ |