| 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_util.h" | 10 #include "base/string_util.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMenuItemInfo.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMenuItemInfo.h" |
| 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
| 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" |
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/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 #include "webkit/glue/webpreferences.h" |
| 42 #include "webkit/plugins/npapi/plugin_list.h" | 43 #include "webkit/plugins/npapi/plugin_list.h" |
| 43 | 44 |
| 44 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) | 45 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) |
| 45 #include "webkit/plugins/plugin_constants.h" | 46 #include "webkit/plugins/plugin_constants.h" |
| 46 #endif | 47 #endif |
| 47 | 48 |
| 48 using content::RenderThread; | 49 using content::RenderThread; |
| 49 using content::RenderView; | 50 using content::RenderView; |
| 50 using WebKit::WebContextMenuData; | 51 using WebKit::WebContextMenuData; |
| 51 using WebKit::WebDocument; | 52 using WebKit::WebDocument; |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, | 633 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, |
| 633 const std::string& mime_type) { | 634 const std::string& mime_type) { |
| 634 std::string host = url.host(); | 635 std::string host = url.host(); |
| 635 bool is_youtube = EndsWith(host, "youtube.com", true) || | 636 bool is_youtube = EndsWith(host, "youtube.com", true) || |
| 636 EndsWith(host, "youtube-nocookie.com", true); | 637 EndsWith(host, "youtube-nocookie.com", true); |
| 637 | 638 |
| 638 return is_youtube && IsValidYouTubeVideo(url.path()) && | 639 return is_youtube && IsValidYouTubeVideo(url.path()) && |
| 639 LowerCaseEqualsASCII(mime_type, kFlashPluginSwfMimeType); | 640 LowerCaseEqualsASCII(mime_type, kFlashPluginSwfMimeType); |
| 640 } | 641 } |
| 641 #endif | 642 #endif |
| OLD | NEW |