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

Side by Side Diff: chrome/browser/about_flags.cc

Issue 7627001: Revert r96364, it's breaking a NaCl test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make it prettier Created 9 years, 4 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 | « no previous file | chrome/browser/automation/testing_automation_provider.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/browser/about_flags.h" 5 #include "chrome/browser/about_flags.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/plugin_updater.h"
17 #include "chrome/browser/prefs/pref_service.h" 18 #include "chrome/browser/prefs/pref_service.h"
18 #include "chrome/browser/prefs/scoped_user_pref_update.h" 19 #include "chrome/browser/prefs/scoped_user_pref_update.h"
19 #include "chrome/common/chrome_content_client.h" 20 #include "chrome/common/chrome_content_client.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
22 #include "content/browser/user_metrics.h" 23 #include "content/browser/user_metrics.h"
23 #include "grit/generated_resources.h" 24 #include "grit/generated_resources.h"
24 #include "ui/base/l10n/l10n_util.h" 25 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/gfx/gl/gl_switches.h" 26 #include "ui/gfx/gl/gl_switches.h"
26 27
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 const Experiment* e = NULL; 718 const Experiment* e = NULL;
718 for (size_t i = 0; i < num_experiments; ++i) { 719 for (size_t i = 0; i < num_experiments; ++i) {
719 if (experiments[i].internal_name == internal_name) { 720 if (experiments[i].internal_name == internal_name) {
720 e = experiments + i; 721 e = experiments + i;
721 break; 722 break;
722 } 723 }
723 } 724 }
724 DCHECK(e); 725 DCHECK(e);
725 726
726 if (e->type == Experiment::SINGLE_VALUE) { 727 if (e->type == Experiment::SINGLE_VALUE) {
727 if (enable) 728 if (enable) {
728 enabled_experiments.insert(internal_name); 729 enabled_experiments.insert(internal_name);
729 else 730 // If enabling NaCl, make sure the plugin is also enabled. See bug
731 // http://code.google.com/p/chromium/issues/detail?id=81010 for more
732 // information.
733 // TODO(dspringer): When NaCl is on by default, remove this code.
734 if (internal_name == switches::kEnableNaCl) {
735 PluginUpdater* plugin_updater = PluginUpdater::GetInstance();
736 string16 nacl_plugin_name =
737 ASCIIToUTF16(chrome::ChromeContentClient::kNaClPluginName);
738 plugin_updater->EnablePluginGroup(true, nacl_plugin_name);
739 }
740 } else {
730 enabled_experiments.erase(internal_name); 741 enabled_experiments.erase(internal_name);
742 }
731 } else { 743 } else {
732 if (enable) { 744 if (enable) {
733 // Enable the first choice. 745 // Enable the first choice.
734 enabled_experiments.insert(NameForChoice(*e, 0)); 746 enabled_experiments.insert(NameForChoice(*e, 0));
735 } else { 747 } else {
736 // Find the currently enabled choice and disable it. 748 // Find the currently enabled choice and disable it.
737 for (int i = 0; i < e->num_choices; ++i) { 749 for (int i = 0; i < e->num_choices; ++i) {
738 std::string choice_name = NameForChoice(*e, i); 750 std::string choice_name = NameForChoice(*e, i);
739 if (enabled_experiments.find(choice_name) != 751 if (enabled_experiments.find(choice_name) !=
740 enabled_experiments.end()) { 752 enabled_experiments.end()) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 } 797 }
786 798
787 const Experiment* GetExperiments(size_t* count) { 799 const Experiment* GetExperiments(size_t* count) {
788 *count = num_experiments; 800 *count = num_experiments;
789 return experiments; 801 return experiments;
790 } 802 }
791 803
792 } // namespace testing 804 } // namespace testing
793 805
794 } // namespace about_flags 806 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698