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

Unified Diff: chrome/renderer/render_view.cc

Issue 464074: Enable Pepper support by default, including building the test plugin.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | webkit/glue/plugins/npapi_extension_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 34100)
+++ chrome/renderer/render_view.cc (working copy)
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#if defined(ENABLE_PEPPER)
-#define PEPPER_APIS_ENABLED
-#endif
-
#include "chrome/renderer/render_view.h"
#include <algorithm>
@@ -2639,24 +2635,36 @@
else
mime_type_to_use = &mime_type;
-#if defined(PEPPER_APIS_ENABLED)
+ bool use_pepper_host = false;
+ bool in_process_plugin = RenderProcess::current()->in_process_plugins();
+ // Check for trusted Pepper plugins.
const char kPepperPrefix[] = "pepper-";
if (StartsWithASCII(*mime_type_to_use, kPepperPrefix, true)) {
- return WebPluginDelegatePepper::Create(
- path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
+ if (CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kInternalPepper)) {
+ in_process_plugin = true;
+ use_pepper_host = true;
+ } else {
+ // In process Pepper plugins must be explicitly enabled.
+ return NULL;
+ }
}
-#endif
-
- bool in_process_plugin = RenderProcess::current()->in_process_plugins();
+ // Check for Native Client modules.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl)) {
if (mime_type == "application/x-nacl-srpc") {
in_process_plugin = true;
+ use_pepper_host = true;
}
}
if (in_process_plugin) {
#if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac.
- return WebPluginDelegateImpl::Create(
- path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
+ if (use_pepper_host) {
+ return WebPluginDelegatePepper::Create(
+ path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
+ } else {
+ return WebPluginDelegateImpl::Create(
+ path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
+ }
#else
NOTIMPLEMENTED();
return NULL;
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | webkit/glue/plugins/npapi_extension_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698