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

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

Issue 7980047: Add about:flags entry to disable WebGL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vangelis review 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/app/generated_resources.grd ('k') | no next file » | 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/prefs/pref_service.h" 17 #include "chrome/browser/prefs/pref_service.h"
18 #include "chrome/browser/prefs/scoped_user_pref_update.h" 18 #include "chrome/browser/prefs/scoped_user_pref_update.h"
19 #include "chrome/common/chrome_content_client.h" 19 #include "chrome/common/chrome_content_client.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
22 #include "content/browser/user_metrics.h" 22 #include "content/browser/user_metrics.h"
23 #include "content/common/content_switches.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
27 namespace about_flags { 28 namespace about_flags {
28 29
29 // Macros to simplify specifying the type. 30 // Macros to simplify specifying the type.
30 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \ 31 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
31 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0 32 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0
32 #define SINGLE_VALUE_TYPE(command_line_switch) \ 33 #define SINGLE_VALUE_TYPE(command_line_switch) \
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 kOsAll, 407 kOsAll,
407 SINGLE_VALUE_TYPE(switches::kDownloadsNewUI) 408 SINGLE_VALUE_TYPE(switches::kDownloadsNewUI)
408 }, 409 },
409 { 410 {
410 "enable-autologin", 411 "enable-autologin",
411 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME, 412 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
412 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION, 413 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
413 kOsMac | kOsWin | kOsLinux, 414 kOsMac | kOsWin | kOsLinux,
414 SINGLE_VALUE_TYPE(switches::kEnableAutologin) 415 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
415 }, 416 },
417 {
vangelis 2011/09/21 22:50:37 Ideally this should be moved to be close to the ot
tfarina 2011/09/21 22:56:24 Done.
418 "disable-webg",
vangelis 2011/09/21 22:50:37 typo: webg
tfarina 2011/09/21 22:56:24 Done.
419 IDS_FLAGS_ENABLE_WEBGL_NAME,
vangelis 2011/09/21 22:50:37 The ID should be renamed to *DISABLE_WEBGL* to mat
tfarina 2011/09/21 22:56:24 Done.
420 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
421 kOsAll,
422 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
423 },
416 }; 424 };
417 425
418 const Experiment* experiments = kExperiments; 426 const Experiment* experiments = kExperiments;
419 size_t num_experiments = arraysize(kExperiments); 427 size_t num_experiments = arraysize(kExperiments);
420 428
421 // Stores and encapsulates the little state that about:flags has. 429 // Stores and encapsulates the little state that about:flags has.
422 class FlagsState { 430 class FlagsState {
423 public: 431 public:
424 FlagsState() : needs_restart_(false) {} 432 FlagsState() : needs_restart_(false) {}
425 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line); 433 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 } 843 }
836 844
837 const Experiment* GetExperiments(size_t* count) { 845 const Experiment* GetExperiments(size_t* count) {
838 *count = num_experiments; 846 *count = num_experiments;
839 return experiments; 847 return experiments;
840 } 848 }
841 849
842 } // namespace testing 850 } // namespace testing
843 851
844 } // namespace about_flags 852 } // namespace about_flags
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698