| 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/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 // Delay loading plugins if prerendering. | 399 // Delay loading plugins if prerendering. |
| 400 if (prerender::PrerenderHelper::IsPrerendering(render_view)) { | 400 if (prerender::PrerenderHelper::IsPrerendering(render_view)) { |
| 401 return CreatePluginPlaceholder( | 401 return CreatePluginPlaceholder( |
| 402 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML, | 402 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML, |
| 403 IDS_PLUGIN_LOAD, true, true); | 403 IDS_PLUGIN_LOAD, true, true); |
| 404 } | 404 } |
| 405 | 405 |
| 406 // Enforce Chrome WebStore restriction on the Native Client plugin. | 406 // Enforce Chrome WebStore restriction on the Native Client plugin. |
| 407 if (info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) { | 407 if (info.name == ASCIIToUTF16(ChromeContentClient::kNaClPluginName)) { |
| 408 bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl); | 408 bool allow_nacl = cmd->HasSwitch(switches::kEnableNaCl); |
| 409 // TODO(elijahtaylor) Remove this #if when crbug.com/92964 is fixed. | |
| 410 #if !(defined(OS_LINUX) && ARCH_CPU_32_BITS) | |
| 411 if (!allow_nacl) { | 409 if (!allow_nacl) { |
| 412 const char* kNaClPluginMimeType = "application/x-nacl"; | 410 const char* kNaClPluginMimeType = "application/x-nacl"; |
| 413 const char* kNaClPluginManifestAttribute = "nacl"; | 411 const char* kNaClPluginManifestAttribute = "nacl"; |
| 414 | 412 |
| 415 GURL nexe_url; | 413 GURL nexe_url; |
| 416 if (actual_mime_type == kNaClPluginMimeType) { | 414 if (actual_mime_type == kNaClPluginMimeType) { |
| 417 nexe_url = url; // Normal embedded NaCl plugin. | 415 nexe_url = url; // Normal embedded NaCl plugin. |
| 418 } else { | 416 } else { |
| 419 // Content type handling NaCl plugin; the "nacl" param on the | 417 // Content type handling NaCl plugin; the "nacl" param on the |
| 420 // MIME type holds the nexe URL. | 418 // MIME type holds the nexe URL. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 438 // Create the NaCl plugin only if the .nexe is part of an extension | 436 // Create the NaCl plugin only if the .nexe is part of an extension |
| 439 // that was installed from the Chrome Web Store, or part of a component | 437 // that was installed from the Chrome Web Store, or part of a component |
| 440 // extension, or part of an unpacked extension. | 438 // extension, or part of an unpacked extension. |
| 441 const Extension* extension = | 439 const Extension* extension = |
| 442 extension_dispatcher_->extensions()->GetByURL(nexe_url); | 440 extension_dispatcher_->extensions()->GetByURL(nexe_url); |
| 443 allow_nacl = extension && | 441 allow_nacl = extension && |
| 444 (extension->from_webstore() || | 442 (extension->from_webstore() || |
| 445 extension->location() == Extension::COMPONENT || | 443 extension->location() == Extension::COMPONENT || |
| 446 extension->location() == Extension::LOAD); | 444 extension->location() == Extension::LOAD); |
| 447 } | 445 } |
| 448 #endif // !(defined(OS_LINUX) && ARCH_CPU_32_BITS) | |
| 449 | 446 |
| 450 if (!allow_nacl) { | 447 if (!allow_nacl) { |
| 451 // TODO(bbudge) Webkit will crash if this is a full-frame plug-in and | 448 // TODO(bbudge) Webkit will crash if this is a full-frame plug-in and |
| 452 // we return NULL. Prepare a patch to fix that, and return NULL here. | 449 // we return NULL. Prepare a patch to fix that, and return NULL here. |
| 453 return CreatePluginPlaceholder( | 450 return CreatePluginPlaceholder( |
| 454 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML, | 451 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML, |
| 455 IDS_PLUGIN_BLOCKED, false, false); | 452 IDS_PLUGIN_BLOCKED, false, false); |
| 456 } | 453 } |
| 457 } | 454 } |
| 458 | 455 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 if (spellcheck_.get()) | 768 if (spellcheck_.get()) |
| 772 thread->RemoveObserver(spellcheck_.get()); | 769 thread->RemoveObserver(spellcheck_.get()); |
| 773 SpellCheck* new_spellcheck = new SpellCheck(); | 770 SpellCheck* new_spellcheck = new SpellCheck(); |
| 774 if (spellcheck_provider_) | 771 if (spellcheck_provider_) |
| 775 spellcheck_provider_->SetSpellCheck(new_spellcheck); | 772 spellcheck_provider_->SetSpellCheck(new_spellcheck); |
| 776 spellcheck_.reset(new_spellcheck); | 773 spellcheck_.reset(new_spellcheck); |
| 777 thread->AddObserver(new_spellcheck); | 774 thread->AddObserver(new_spellcheck); |
| 778 } | 775 } |
| 779 | 776 |
| 780 } // namespace chrome | 777 } // namespace chrome |
| OLD | NEW |