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

Unified Diff: chrome/browser/about_flags.cc

Issue 7049012: Cause the 'enable-nacl' flag to be locked with enabling the NaCl plugin. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Use const for "enable-nacl" Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_content_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 90a5c3828fee977a6a6cc921b13460a454f56c3e..64666fcf5cca13eda705fa3443ff165b6794bd28 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -12,9 +12,12 @@
#include "base/command_line.h"
#include "base/memory/singleton.h"
#include "base/string_number_conversions.h"
+#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "chrome/browser/plugin_updater.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
+#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/browser/user_metrics.h"
@@ -175,8 +178,9 @@ const Experiment kExperiments[] = {
SINGLE_VALUE_TYPE(switches::kEnablePrintPreview)
},
#endif
+ // TODO(dspringer): When NaCl is on by default, remove this flag entry.
{
- "enable-nacl", // FLAGS:RECORD_UMA
+ switches::kEnableNaCl, // FLAGS:RECORD_UMA
IDS_FLAGS_ENABLE_NACL_NAME,
IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
kOsAll,
@@ -686,10 +690,21 @@ void FlagsState::SetExperimentEnabled(
DCHECK(e);
if (e->type == Experiment::SINGLE_VALUE) {
- if (enable)
+ if (enable) {
enabled_experiments.insert(internal_name);
- else
+ // If enabling NaCl, make sure the plugin is also enabled. See bug
+ // http://code.google.com/p/chromium/issues/detail?id=81010 for more
+ // information.
+ // TODO(dspringer): When NaCl is on by default, remove this code.
+ if (internal_name == switches::kEnableNaCl) {
+ PluginUpdater* plugin_updater = PluginUpdater::GetInstance();
+ string16 nacl_plugin_name =
+ ASCIIToUTF16(chrome::ChromeContentClient::kNaClPluginName);
+ plugin_updater->EnablePluginGroup(true, nacl_plugin_name);
+ }
+ } else {
enabled_experiments.erase(internal_name);
+ }
} else {
if (enable) {
// Enable the first choice.
« no previous file with comments | « no previous file | chrome/common/chrome_content_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698