| 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/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "third_party/WebKit/public/web/WebFrame.h" | 33 #include "third_party/WebKit/public/web/WebFrame.h" |
| 34 #include "third_party/WebKit/public/web/WebInputEvent.h" | 34 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 35 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 35 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| 36 #include "third_party/WebKit/public/web/WebScriptSource.h" | 36 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 37 #include "third_party/WebKit/public/web/WebView.h" | 37 #include "third_party/WebKit/public/web/WebView.h" |
| 38 #include "third_party/re2/re2/re2.h" | 38 #include "third_party/re2/re2/re2.h" |
| 39 #include "ui/base/l10n/l10n_util.h" | 39 #include "ui/base/l10n/l10n_util.h" |
| 40 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
| 41 #include "ui/webui/jstemplate_builder.h" | 41 #include "ui/webui/jstemplate_builder.h" |
| 42 | 42 |
| 43 using content::RenderThread; | |
| 44 using content::RenderView; | |
| 45 using WebKit::WebContextMenuData; | 43 using WebKit::WebContextMenuData; |
| 46 using WebKit::WebDocument; | 44 using WebKit::WebDocument; |
| 47 using WebKit::WebElement; | 45 using WebKit::WebElement; |
| 48 using WebKit::WebFrame; | 46 using WebKit::WebFrame; |
| 49 using WebKit::WebMouseEvent; | 47 using WebKit::WebMouseEvent; |
| 50 using WebKit::WebNode; | 48 using WebKit::WebNode; |
| 51 using WebKit::WebPlugin; | 49 using WebKit::WebPlugin; |
| 52 using WebKit::WebPluginContainer; | 50 using WebKit::WebPluginContainer; |
| 53 using WebKit::WebPluginParams; | 51 using WebKit::WebPluginParams; |
| 54 using WebKit::WebPoint; | 52 using WebKit::WebPoint; |
| 55 using WebKit::WebScriptSource; | 53 using WebKit::WebScriptSource; |
| 56 using WebKit::WebString; | 54 using WebKit::WebString; |
| 57 using WebKit::WebURLRequest; | 55 using WebKit::WebURLRequest; |
| 58 using WebKit::WebVector; | 56 using WebKit::WebVector; |
| 59 using webkit_glue::CppArgumentList; | 57 using content::CppArgumentList; |
| 60 using webkit_glue::CppVariant; | 58 using content::CppVariant; |
| 59 using content::RenderThread; |
| 60 using content::RenderView; |
| 61 | 61 |
| 62 const char* const kPluginPlaceholderDataURL = | 62 const char* const kPluginPlaceholderDataURL = |
| 63 "chrome://pluginplaceholderdata/"; | 63 "chrome://pluginplaceholderdata/"; |
| 64 | 64 |
| 65 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) | 65 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) |
| 66 // Strings we used to parse the youtube plugin url. | 66 // Strings we used to parse the youtube plugin url. |
| 67 const char* const kSlashVSlash = "/v/"; | 67 const char* const kSlashVSlash = "/v/"; |
| 68 const char* const kSlashESlash = "/e/"; | 68 const char* const kSlashESlash = "/e/"; |
| 69 #endif | 69 #endif |
| 70 | 70 |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, | 617 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, |
| 618 const std::string& mime_type) { | 618 const std::string& mime_type) { |
| 619 std::string host = url.host(); | 619 std::string host = url.host(); |
| 620 bool is_youtube = EndsWith(host, "youtube.com", true) || | 620 bool is_youtube = EndsWith(host, "youtube.com", true) || |
| 621 EndsWith(host, "youtube-nocookie.com", true); | 621 EndsWith(host, "youtube-nocookie.com", true); |
| 622 | 622 |
| 623 return is_youtube && IsValidYouTubeVideo(url.path()) && | 623 return is_youtube && IsValidYouTubeVideo(url.path()) && |
| 624 LowerCaseEqualsASCII(mime_type, content::kFlashPluginSwfMimeType); | 624 LowerCaseEqualsASCII(mime_type, content::kFlashPluginSwfMimeType); |
| 625 } | 625 } |
| 626 #endif | 626 #endif |
| OLD | NEW |