 Chromium Code Reviews
 Chromium Code Reviews Issue 10910168:
  Separate plugin_metadata from plugin_installer, thread-safe plugin_finder  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@master
    
  
    Issue 10910168:
  Separate plugin_metadata from plugin_installer, thread-safe plugin_finder  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@master| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 return; | 431 return; | 
| 432 WebDocument document = frame_->top()->document(); | 432 WebDocument document = frame_->top()->document(); | 
| 433 if (document.isNull()) | 433 if (document.isNull()) | 
| 434 return; | 434 return; | 
| 435 | 435 | 
| 436 ChromeViewHostMsg_GetPluginInfo_Output output; | 436 ChromeViewHostMsg_GetPluginInfo_Output output; | 
| 437 std::string mime_type(plugin_params_.mimeType.utf8()); | 437 std::string mime_type(plugin_params_.mimeType.utf8()); | 
| 438 render_view()->Send(new ChromeViewHostMsg_GetPluginInfo( | 438 render_view()->Send(new ChromeViewHostMsg_GetPluginInfo( | 
| 439 routing_id(), GURL(plugin_params_.url), document.url(), | 439 routing_id(), GURL(plugin_params_.url), document.url(), | 
| 440 mime_type, &output)); | 440 mime_type, &output)); | 
| 441 | |
| 
Bernhard Bauer
2012/09/24 09:14:25
Nit: This change is unnecessary now.
 
ibraaaa
2012/09/24 11:01:07
Done.
 | |
| 442 if (output.status.value == status_->value) | 441 if (output.status.value == status_->value) | 
| 443 return; | 442 return; | 
| 444 chrome::ChromeContentRendererClient* client = | 443 chrome::ChromeContentRendererClient* client = | 
| 445 static_cast<chrome::ChromeContentRendererClient*>( | 444 static_cast<chrome::ChromeContentRendererClient*>( | 
| 446 content::GetContentClient()->renderer()); | 445 content::GetContentClient()->renderer()); | 
| 447 WebPlugin* new_plugin = | 446 WebPlugin* new_plugin = | 
| 448 client->CreatePlugin(render_view(), frame_, plugin_params_, output); | 447 client->CreatePlugin(render_view(), frame_, plugin_params_, output); | 
| 449 ReplacePlugin(new_plugin); | 448 ReplacePlugin(new_plugin); | 
| 450 } | 449 } | 
| 451 | 450 | 
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, | 626 bool PluginPlaceholder::IsYouTubeURL(const GURL& url, | 
| 628 const std::string& mime_type) { | 627 const std::string& mime_type) { | 
| 629 std::string host = url.host(); | 628 std::string host = url.host(); | 
| 630 bool is_youtube = EndsWith(host, "youtube.com", true) || | 629 bool is_youtube = EndsWith(host, "youtube.com", true) || | 
| 631 EndsWith(host, "youtube-nocookie.com", true); | 630 EndsWith(host, "youtube-nocookie.com", true); | 
| 632 | 631 | 
| 633 return is_youtube && IsValidYouTubeVideo(url.path()) && | 632 return is_youtube && IsValidYouTubeVideo(url.path()) && | 
| 634 LowerCaseEqualsASCII(mime_type, "application/x-shockwave-flash"); | 633 LowerCaseEqualsASCII(mime_type, "application/x-shockwave-flash"); | 
| 635 } | 634 } | 
| 636 #endif | 635 #endif | 
| OLD | NEW |