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> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "ash/ash_switches.h" | |
14 #include "base/command_line.h" | 13 #include "base/command_line.h" |
15 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.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" |
23 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 }; | 91 }; |
93 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i) | 92 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i) |
94 if (bitmask & kBitsToOs[i].bit) | 93 if (bitmask & kBitsToOs[i].bit) |
95 list->Append(new base::StringValue(kBitsToOs[i].name)); | 94 list->Append(new base::StringValue(kBitsToOs[i].name)); |
96 } | 95 } |
97 | 96 |
98 // Convert switch constants to proper CommandLine::StringType strings. | 97 // Convert switch constants to proper CommandLine::StringType strings. |
99 CommandLine::StringType GetSwitchString(const std::string& flag) { | 98 CommandLine::StringType GetSwitchString(const std::string& flag) { |
100 CommandLine cmd_line(CommandLine::NO_PROGRAM); | 99 CommandLine cmd_line(CommandLine::NO_PROGRAM); |
101 cmd_line.AppendSwitch(flag); | 100 cmd_line.AppendSwitch(flag); |
102 DCHECK(cmd_line.argv().size() == 2); | 101 DCHECK_EQ(2U, cmd_line.argv().size()); |
103 return cmd_line.argv()[1]; | 102 return cmd_line.argv()[1]; |
104 } | 103 } |
105 | 104 |
106 // Scoops flags from a command line. | 105 // Scoops flags from a command line. |
107 std::set<CommandLine::StringType> ExtractFlagsFromCommandLine( | 106 std::set<CommandLine::StringType> ExtractFlagsFromCommandLine( |
108 const CommandLine& cmdline) { | 107 const CommandLine& cmdline) { |
109 std::set<CommandLine::StringType> flags; | 108 std::set<CommandLine::StringType> flags; |
110 // First do the ones between --flag-switches-begin and --flag-switches-end. | 109 // First do the ones between --flag-switches-begin and --flag-switches-end. |
111 CommandLine::StringVector::const_iterator first = | 110 CommandLine::StringVector::const_iterator first = |
112 std::find(cmdline.argv().begin(), cmdline.argv().end(), | 111 std::find(cmdline.argv().begin(), cmdline.argv().end(), |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1216 kOsAll, | 1215 kOsAll, |
1217 MULTI_VALUE_TYPE(kImplSidePaintingChoices) | 1216 MULTI_VALUE_TYPE(kImplSidePaintingChoices) |
1218 }, | 1217 }, |
1219 { | 1218 { |
1220 "lcd-text-aa", | 1219 "lcd-text-aa", |
1221 IDS_FLAGS_LCD_TEXT_NAME, | 1220 IDS_FLAGS_LCD_TEXT_NAME, |
1222 IDS_FLAGS_LCD_TEXT_DESCRIPTION, | 1221 IDS_FLAGS_LCD_TEXT_DESCRIPTION, |
1223 kOsDesktop, | 1222 kOsDesktop, |
1224 MULTI_VALUE_TYPE(kLCDTextChoices) | 1223 MULTI_VALUE_TYPE(kLCDTextChoices) |
1225 }, | 1224 }, |
1226 #ifndef USE_AURA | 1225 #if defined(OS_ANDROID) |
piman
2014/05/15 16:57:47
Actually, we want this on mac too.
Lei Zhang
2014/05/20 02:38:21
Are you going to do that in a different CL soon? A
piman
2014/05/20 02:50:58
Basic support just got added last week - https://c
| |
1227 { | 1226 { |
1228 "delegated-renderer", | 1227 "delegated-renderer", |
1229 IDS_FLAGS_DELEGATED_RENDERER_NAME, | 1228 IDS_FLAGS_DELEGATED_RENDERER_NAME, |
1230 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION, | 1229 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION, |
1231 kOsAndroid, | 1230 kOsAndroid, |
1232 MULTI_VALUE_TYPE(kDelegatedRendererChoices) | 1231 MULTI_VALUE_TYPE(kDelegatedRendererChoices) |
1233 }, | 1232 }, |
1234 #endif | 1233 #endif |
1235 { | 1234 { |
1236 "max-tiles-for-interest-area", | 1235 "max-tiles-for-interest-area", |
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2401 } | 2400 } |
2402 | 2401 |
2403 const Experiment* GetExperiments(size_t* count) { | 2402 const Experiment* GetExperiments(size_t* count) { |
2404 *count = num_experiments; | 2403 *count = num_experiments; |
2405 return experiments; | 2404 return experiments; |
2406 } | 2405 } |
2407 | 2406 |
2408 } // namespace testing | 2407 } // namespace testing |
2409 | 2408 |
2410 } // namespace about_flags | 2409 } // namespace about_flags |
OLD | NEW |