OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 WebPluginParams params(original_params); | 351 WebPluginParams params(original_params); |
352 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { | 352 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { |
353 if (plugin.mime_types[i].mime_type == actual_mime_type) { | 353 if (plugin.mime_types[i].mime_type == actual_mime_type) { |
354 AppendParams(plugin.mime_types[i].additional_param_names, | 354 AppendParams(plugin.mime_types[i].additional_param_names, |
355 plugin.mime_types[i].additional_param_values, | 355 plugin.mime_types[i].additional_param_values, |
356 ¶ms.attributeNames, | 356 ¶ms.attributeNames, |
357 ¶ms.attributeValues); | 357 ¶ms.attributeValues); |
358 break; | 358 break; |
359 } | 359 } |
360 } | 360 } |
| 361 |
| 362 if (params.mimeType.isNull() && (actual_mime_type.size() > 0)) { |
| 363 // Webkit might say that mime type is null while we already know the |
| 364 // actual mime type via ChromeViewHostMsg_GetPluginInfo. In that case |
| 365 // we should use what we know since WebpluginDelegateProxy does some |
| 366 // specific initializations based on this information. |
| 367 params.mimeType = WebString::fromUTF8(actual_mime_type.c_str()); |
| 368 } |
361 | 369 |
362 ContentSetting outdated_policy = CONTENT_SETTING_ASK; | 370 ContentSetting outdated_policy = CONTENT_SETTING_ASK; |
363 ContentSetting authorize_policy = CONTENT_SETTING_ASK; | 371 ContentSetting authorize_policy = CONTENT_SETTING_ASK; |
364 if (group->IsVulnerable(plugin) || | 372 if (group->IsVulnerable(plugin) || |
365 group->RequiresAuthorization(plugin)) { | 373 group->RequiresAuthorization(plugin)) { |
366 // These policies are dynamic and can changed at runtime, so they aren't | 374 // These policies are dynamic and can changed at runtime, so they aren't |
367 // cached here. | 375 // cached here. |
368 render_view->Send(new ChromeViewHostMsg_GetPluginPolicies( | 376 render_view->Send(new ChromeViewHostMsg_GetPluginPolicies( |
369 &outdated_policy, &authorize_policy)); | 377 &outdated_policy, &authorize_policy)); |
370 } | 378 } |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 | 865 |
858 bool ChromeContentRendererClient::IsAdblockPlusWithWebRequestInstalled() { | 866 bool ChromeContentRendererClient::IsAdblockPlusWithWebRequestInstalled() { |
859 return extension_dispatcher_->IsAdblockPlusWithWebRequestInstalled(); | 867 return extension_dispatcher_->IsAdblockPlusWithWebRequestInstalled(); |
860 } | 868 } |
861 | 869 |
862 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 870 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
863 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 871 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
864 } | 872 } |
865 | 873 |
866 } // namespace chrome | 874 } // namespace chrome |
OLD | NEW |