Update comments of TabObserver#onLoadStarted and rename onContentChanged
[chromium-blink-merge.git] / components / plugins / renderer / mobile_youtube_plugin.h
blob46f336258e71301445fbad5657e483c29ed5768d
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_
6 #define COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_
8 #include "components/plugins/renderer/plugin_placeholder.h"
10 namespace plugins {
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
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
16 // mobile youtube app.
17 class MobileYouTubePlugin : public PluginPlaceholder {
18 public:
19 MobileYouTubePlugin(content::RenderFrame* render_frame,
20 blink::WebLocalFrame* frame,
21 const blink::WebPluginParams& params,
22 base::StringPiece& template_html);
24 // Whether this is a youtube url.
25 static bool IsYouTubeURL(const GURL& url, const std::string& mime_type);
27 private:
28 ~MobileYouTubePlugin() override;
30 // Opens a youtube app in the current tab.
31 void OpenYoutubeUrlCallback();
33 // gin::Wrappable (via PluginPlaceholder) method
34 gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
35 v8::Isolate* isolate) override;
37 DISALLOW_COPY_AND_ASSIGN(MobileYouTubePlugin);
40 } // namespace plugins
42 #endif // COMPONENTS_PLUGINS_RENDERER_MOBILE_YOUTUBE_PLUGIN_H_