Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 | 34 |
| 35 // Macros to simplify specifying the type. | 35 // Macros to simplify specifying the type. |
| 36 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \ | 36 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \ |
| 37 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0 | 37 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0 |
| 38 #define SINGLE_VALUE_TYPE(command_line_switch) \ | 38 #define SINGLE_VALUE_TYPE(command_line_switch) \ |
| 39 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "") | 39 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "") |
| 40 #define MULTI_VALUE_TYPE(choices) \ | 40 #define MULTI_VALUE_TYPE(choices) \ |
| 41 Experiment::MULTI_VALUE, "", "", choices, arraysize(choices) | 41 Experiment::MULTI_VALUE, "", "", choices, arraysize(choices) |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | |
| 45 const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS; | 44 const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS; |
| 46 | 45 |
| 47 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates | 46 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates |
| 48 // whether the experiment is available on that platform. | 47 // whether the experiment is available on that platform. |
| 49 void AddOsStrings(unsigned bitmask, ListValue* list) { | 48 void AddOsStrings(unsigned bitmask, ListValue* list) { |
| 50 struct { | 49 struct { |
| 51 unsigned bit; | 50 unsigned bit; |
| 52 const char* const name; | 51 const char* const name; |
| 53 } kBitsToOs[] = { | 52 } kBitsToOs[] = { |
| 54 {kOsMac, "Mac"}, | 53 {kOsMac, "Mac"}, |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 SINGLE_VALUE_TYPE(ash::switches::kAuraTranslucentFrames) | 465 SINGLE_VALUE_TYPE(ash::switches::kAuraTranslucentFrames) |
| 467 }, | 466 }, |
| 468 #endif // defined(USE_AURA) | 467 #endif // defined(USE_AURA) |
| 469 { | 468 { |
| 470 "enable-gamepad", | 469 "enable-gamepad", |
| 471 IDS_FLAGS_ENABLE_GAMEPAD_NAME, | 470 IDS_FLAGS_ENABLE_GAMEPAD_NAME, |
| 472 IDS_FLAGS_ENABLE_GAMEPAD_DESCRIPTION, | 471 IDS_FLAGS_ENABLE_GAMEPAD_DESCRIPTION, |
| 473 kOsMac | kOsWin, | 472 kOsMac | kOsWin, |
| 474 SINGLE_VALUE_TYPE(switches::kEnableGamepad) | 473 SINGLE_VALUE_TYPE(switches::kEnableGamepad) |
| 475 }, | 474 }, |
| 476 #if defined(USE_AURA) | 475 #if defined(USE_AURA) && defined(SHOW_ABOUT_FLAG_AURA_WINDOW_MODE) |
|
James Cook
2012/01/07 04:26:48
Maybe this should be a single #if defined(AURA_SHO
alicet1
2012/01/09 08:52:16
Done.
| |
| 477 // TODO(jamescook): Enable this for all ChromeOS builds when we're sure | 476 // TODO(jamescook): Enable this for all ChromeOS builds when we're sure |
| 478 // Aura laptop mode performance and feature set match traditional non-Aura | 477 // Aura laptop mode performance and feature set match traditional non-Aura |
| 479 // builds. | 478 // builds. |
| 480 { | 479 { |
| 481 "aura-window-mode", | 480 "aura-window-mode", |
| 482 IDS_FLAGS_AURA_WINDOW_MODE_NAME, | 481 IDS_FLAGS_AURA_WINDOW_MODE_NAME, |
| 483 IDS_FLAGS_AURA_WINDOW_MODE_DESCRIPTION, | 482 IDS_FLAGS_AURA_WINDOW_MODE_DESCRIPTION, |
| 484 kOsWin | kOsLinux | kOsCrOS, | 483 kOsWin | kOsLinux | kOsCrOS, |
| 485 MULTI_VALUE_TYPE(kAuraWindowModeChoices) | 484 MULTI_VALUE_TYPE(kAuraWindowModeChoices) |
| 486 }, | 485 }, |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 936 } | 935 } |
| 937 | 936 |
| 938 const Experiment* GetExperiments(size_t* count) { | 937 const Experiment* GetExperiments(size_t* count) { |
| 939 *count = num_experiments; | 938 *count = num_experiments; |
| 940 return experiments; | 939 return experiments; |
| 941 } | 940 } |
| 942 | 941 |
| 943 } // namespace testing | 942 } // namespace testing |
| 944 | 943 |
| 945 } // namespace about_flags | 944 } // namespace about_flags |
| OLD | NEW |