| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) | 306 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) |
| 307 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering) | 307 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering) |
| 308 IPC_END_MESSAGE_MAP() | 308 IPC_END_MESSAGE_MAP() |
| 309 | 309 |
| 310 return false; | 310 return false; |
| 311 } | 311 } |
| 312 | 312 |
| 313 void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) { | 313 void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) { |
| 314 CHECK(plugin_); | 314 CHECK(plugin_); |
| 315 if (!new_plugin) { | 315 if (!new_plugin) { |
| 316 MissingPluginReporter::GetInstance()->ReportPluginMissing( | 316 PluginUMAReporter::GetInstance()->ReportPluginMissing( |
| 317 plugin_params_.mimeType.utf8(), | 317 plugin_params_.mimeType.utf8(), |
| 318 plugin_params_.url); | 318 plugin_params_.url); |
| 319 return; | 319 return; |
| 320 } | 320 } |
| 321 | 321 |
| 322 WebPluginContainer* container = plugin_->container(); | 322 WebPluginContainer* container = plugin_->container(); |
| 323 // Set the new plug-in on the container before initializing it. | 323 // Set the new plug-in on the container before initializing it. |
| 324 container->setPlugin(new_plugin); | 324 container->setPlugin(new_plugin); |
| 325 // Save the element in case the plug-in is removed from the page during | 325 // Save the element in case the plug-in is removed from the page during |
| 326 // initialization. | 326 // initialization. |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, | 638 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, |
| 639 const std::string& mime_type) { | 639 const std::string& mime_type) { |
| 640 std::string host = url.host(); | 640 std::string host = url.host(); |
| 641 bool is_youtube = EndsWith(host, "youtube.com", true) || | 641 bool is_youtube = EndsWith(host, "youtube.com", true) || |
| 642 EndsWith(host, "youtube-nocookie.com", true); | 642 EndsWith(host, "youtube-nocookie.com", true); |
| 643 | 643 |
| 644 return is_youtube && IsValidYouTubeVideo(url.path()) && | 644 return is_youtube && IsValidYouTubeVideo(url.path()) && |
| 645 LowerCaseEqualsASCII(mime_type, kFlashPluginSwfMimeType); | 645 LowerCaseEqualsASCII(mime_type, kFlashPluginSwfMimeType); |
| 646 } | 646 } |
| 647 #endif | 647 #endif |
| OLD | NEW |