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 <iterator> | 7 #include <iterator> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "ash/ash_switches.h" | |
13 #include "base/command_line.h" | 12 #include "base/command_line.h" |
14 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
15 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
16 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
18 #include "base/values.h" | 17 #include "base/values.h" |
19 #include "cc/base/switches.h" | 18 #include "cc/base/switches.h" |
20 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 19 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
21 #include "chrome/browser/flags_storage.h" | 20 #include "chrome/browser/flags_storage.h" |
22 #include "chrome/common/chrome_content_client.h" | 21 #include "chrome/common/chrome_content_client.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 }; | 92 }; |
94 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i) | 93 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i) |
95 if (bitmask & kBitsToOs[i].bit) | 94 if (bitmask & kBitsToOs[i].bit) |
96 list->Append(new base::StringValue(kBitsToOs[i].name)); | 95 list->Append(new base::StringValue(kBitsToOs[i].name)); |
97 } | 96 } |
98 | 97 |
99 // Convert switch constants to proper CommandLine::StringType strings. | 98 // Convert switch constants to proper CommandLine::StringType strings. |
100 CommandLine::StringType GetSwitchString(const std::string& flag) { | 99 CommandLine::StringType GetSwitchString(const std::string& flag) { |
101 CommandLine cmd_line(CommandLine::NO_PROGRAM); | 100 CommandLine cmd_line(CommandLine::NO_PROGRAM); |
102 cmd_line.AppendSwitch(flag); | 101 cmd_line.AppendSwitch(flag); |
103 DCHECK(cmd_line.argv().size() == 2); | 102 DCHECK_EQ(2U, cmd_line.argv().size()); |
104 return cmd_line.argv()[1]; | 103 return cmd_line.argv()[1]; |
105 } | 104 } |
106 | 105 |
107 // Scoops flags from a command line. | 106 // Scoops flags from a command line. |
108 std::set<CommandLine::StringType> ExtractFlagsFromCommandLine( | 107 std::set<CommandLine::StringType> ExtractFlagsFromCommandLine( |
109 const CommandLine& cmdline) { | 108 const CommandLine& cmdline) { |
110 std::set<CommandLine::StringType> flags; | 109 std::set<CommandLine::StringType> flags; |
111 // First do the ones between --flag-switches-begin and --flag-switches-end. | 110 // First do the ones between --flag-switches-begin and --flag-switches-end. |
112 CommandLine::StringVector::const_iterator first = | 111 CommandLine::StringVector::const_iterator first = |
113 std::find(cmdline.argv().begin(), cmdline.argv().end(), | 112 std::find(cmdline.argv().begin(), cmdline.argv().end(), |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 kOsAll, | 1209 kOsAll, |
1211 MULTI_VALUE_TYPE(kImplSidePaintingChoices) | 1210 MULTI_VALUE_TYPE(kImplSidePaintingChoices) |
1212 }, | 1211 }, |
1213 { | 1212 { |
1214 "lcd-text-aa", | 1213 "lcd-text-aa", |
1215 IDS_FLAGS_LCD_TEXT_NAME, | 1214 IDS_FLAGS_LCD_TEXT_NAME, |
1216 IDS_FLAGS_LCD_TEXT_DESCRIPTION, | 1215 IDS_FLAGS_LCD_TEXT_DESCRIPTION, |
1217 kOsDesktop, | 1216 kOsDesktop, |
1218 MULTI_VALUE_TYPE(kLCDTextChoices) | 1217 MULTI_VALUE_TYPE(kLCDTextChoices) |
1219 }, | 1218 }, |
1220 #ifndef USE_AURA | 1219 #if defined(OS_ANDROID) || defined(OS_MACOSX) |
1221 { | 1220 { |
1222 "delegated-renderer", | 1221 "delegated-renderer", |
1223 IDS_FLAGS_DELEGATED_RENDERER_NAME, | 1222 IDS_FLAGS_DELEGATED_RENDERER_NAME, |
1224 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION, | 1223 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION, |
1225 kOsAndroid, | 1224 kOsAndroid, // TODO(ccameron) Add mac support soon. |
1226 MULTI_VALUE_TYPE(kDelegatedRendererChoices) | 1225 MULTI_VALUE_TYPE(kDelegatedRendererChoices) |
1227 }, | 1226 }, |
1228 #endif | 1227 #endif |
1229 { | 1228 { |
1230 "max-tiles-for-interest-area", | 1229 "max-tiles-for-interest-area", |
1231 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME, | 1230 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME, |
1232 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION, | 1231 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION, |
1233 kOsAll, | 1232 kOsAll, |
1234 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices) | 1233 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices) |
1235 }, | 1234 }, |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2398 } | 2397 } |
2399 | 2398 |
2400 const Experiment* GetExperiments(size_t* count) { | 2399 const Experiment* GetExperiments(size_t* count) { |
2401 *count = num_experiments; | 2400 *count = num_experiments; |
2402 return experiments; | 2401 return experiments; |
2403 } | 2402 } |
2404 | 2403 |
2405 } // namespace testing | 2404 } // namespace testing |
2406 | 2405 |
2407 } // namespace about_flags | 2406 } // namespace about_flags |
OLD | NEW |