OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/renderer/plugins/plugin_placeholder.h" | 5 #include "chrome/renderer/plugins/plugin_placeholder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
40 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
41 #include "ui/base/layout.h" | 41 #include "ui/base/layout.h" |
42 #include "ui/base/resource/resource_bundle.h" | 42 #include "ui/base/resource/resource_bundle.h" |
43 #include "webkit/glue/webpreferences.h" | 43 #include "webkit/glue/webpreferences.h" |
44 #include "webkit/plugins/npapi/plugin_list.h" | 44 #include "webkit/plugins/npapi/plugin_list.h" |
45 #include "webkit/plugins/webview_plugin.h" | 45 #include "webkit/plugins/webview_plugin.h" |
46 | 46 |
| 47 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) |
| 48 #include "webkit/plugins/plugin_constants.h" |
| 49 #endif |
| 50 |
47 using content::RenderThread; | 51 using content::RenderThread; |
48 using content::RenderView; | 52 using content::RenderView; |
49 using WebKit::WebContextMenuData; | 53 using WebKit::WebContextMenuData; |
50 using WebKit::WebDocument; | 54 using WebKit::WebDocument; |
51 using WebKit::WebElement; | 55 using WebKit::WebElement; |
52 using WebKit::WebFrame; | 56 using WebKit::WebFrame; |
53 using WebKit::WebMenuItemInfo; | 57 using WebKit::WebMenuItemInfo; |
54 using WebKit::WebMouseEvent; | 58 using WebKit::WebMouseEvent; |
55 using WebKit::WebNode; | 59 using WebKit::WebNode; |
56 using WebKit::WebPlugin; | 60 using WebKit::WebPlugin; |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 return true; | 627 return true; |
624 } | 628 } |
625 | 629 |
626 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, | 630 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, |
627 const std::string& mime_type) { | 631 const std::string& mime_type) { |
628 std::string host = url.host(); | 632 std::string host = url.host(); |
629 bool is_youtube = EndsWith(host, "youtube.com", true) || | 633 bool is_youtube = EndsWith(host, "youtube.com", true) || |
630 EndsWith(host, "youtube-nocookie.com", true); | 634 EndsWith(host, "youtube-nocookie.com", true); |
631 | 635 |
632 return is_youtube && IsValidYouTubeVideo(url.path()) && | 636 return is_youtube && IsValidYouTubeVideo(url.path()) && |
633 LowerCaseEqualsASCII(mime_type, "application/x-shockwave-flash"); | 637 LowerCaseEqualsASCII(mime_type, kFlashPluginSwfMimeType); |
634 } | 638 } |
635 #endif | 639 #endif |
OLD | NEW |