| 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/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 return placeholder->plugin(); | 933 return placeholder->plugin(); |
| 934 } | 934 } |
| 935 | 935 |
| 936 // For NaCl content handling plugins, the NaCl manifest is stored in an | 936 // For NaCl content handling plugins, the NaCl manifest is stored in an |
| 937 // additonal 'nacl' param associated with the MIME type. | 937 // additonal 'nacl' param associated with the MIME type. |
| 938 // static | 938 // static |
| 939 GURL ChromeContentRendererClient::GetNaClContentHandlerURL( | 939 GURL ChromeContentRendererClient::GetNaClContentHandlerURL( |
| 940 const std::string& actual_mime_type, | 940 const std::string& actual_mime_type, |
| 941 const content::WebPluginInfo& plugin) { | 941 const content::WebPluginInfo& plugin) { |
| 942 // Look for the manifest URL among the MIME type's additonal parameters. | 942 // Look for the manifest URL among the MIME type's additonal parameters. |
| 943 const char* kNaClPluginManifestAttribute = "nacl"; | 943 const char kNaClPluginManifestAttribute[] = "nacl"; |
| 944 base::string16 nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute); | 944 base::string16 nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute); |
| 945 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { | 945 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { |
| 946 if (plugin.mime_types[i].mime_type == actual_mime_type) { | 946 if (plugin.mime_types[i].mime_type == actual_mime_type) { |
| 947 const content::WebPluginMimeType& content_type = plugin.mime_types[i]; | 947 const content::WebPluginMimeType& content_type = plugin.mime_types[i]; |
| 948 for (size_t i = 0; i < content_type.additional_param_names.size(); ++i) { | 948 for (size_t i = 0; i < content_type.additional_param_names.size(); ++i) { |
| 949 if (content_type.additional_param_names[i] == nacl_attr) | 949 if (content_type.additional_param_names[i] == nacl_attr) |
| 950 return GURL(content_type.additional_param_values[i]); | 950 return GURL(content_type.additional_param_values[i]); |
| 951 } | 951 } |
| 952 break; | 952 break; |
| 953 } | 953 } |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 content::BrowserPluginDelegate* | 1571 content::BrowserPluginDelegate* |
| 1572 ChromeContentRendererClient::CreateBrowserPluginDelegate( | 1572 ChromeContentRendererClient::CreateBrowserPluginDelegate( |
| 1573 content::RenderFrame* render_frame, | 1573 content::RenderFrame* render_frame, |
| 1574 const std::string& mime_type) { | 1574 const std::string& mime_type) { |
| 1575 #if defined(ENABLE_EXTENSIONS) | 1575 #if defined(ENABLE_EXTENSIONS) |
| 1576 return new extensions::GuestViewContainer(render_frame, mime_type); | 1576 return new extensions::GuestViewContainer(render_frame, mime_type); |
| 1577 #else | 1577 #else |
| 1578 return NULL; | 1578 return NULL; |
| 1579 #endif | 1579 #endif |
| 1580 } | 1580 } |
| OLD | NEW |