Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 7821021: Enable nacl_helper by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Eliminate --nacl-linux-helper flag Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/nacl/nacl_fork_delegate_linux.cc ('k') | content/browser/zygote_host_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « chrome/nacl/nacl_fork_delegate_linux.cc ('k') | content/browser/zygote_host_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698