OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/flags_ui/flags_state.h" | 5 #include "components/flags_ui/flags_state.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 {kOsAndroid, "Android"}, | 75 {kOsAndroid, "Android"}, |
76 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"}, | 76 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"}, |
77 {kOsIos, "iOS"}, | 77 {kOsIos, "iOS"}, |
78 }; | 78 }; |
79 | 79 |
80 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates | 80 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates |
81 // whether the entry is available on that platform. | 81 // whether the entry is available on that platform. |
82 void AddOsStrings(unsigned bitmask, base::ListValue* list) { | 82 void AddOsStrings(unsigned bitmask, base::ListValue* list) { |
83 for (size_t i = 0; i < arraysize(kBitsToOs); ++i) { | 83 for (size_t i = 0; i < arraysize(kBitsToOs); ++i) { |
84 if (bitmask & kBitsToOs[i].bit) | 84 if (bitmask & kBitsToOs[i].bit) |
85 list->Append(new base::StringValue(kBitsToOs[i].name)); | 85 list->AppendString(kBitsToOs[i].name); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 // Adds the internal names for the specified entry to |names|. | 89 // Adds the internal names for the specified entry to |names|. |
90 void AddInternalName(const FeatureEntry& e, std::set<std::string>* names) { | 90 void AddInternalName(const FeatureEntry& e, std::set<std::string>* names) { |
91 switch (e.type) { | 91 switch (e.type) { |
92 case FeatureEntry::SINGLE_VALUE: | 92 case FeatureEntry::SINGLE_VALUE: |
93 case FeatureEntry::SINGLE_DISABLE_VALUE: | 93 case FeatureEntry::SINGLE_DISABLE_VALUE: |
94 names->insert(e.internal_name); | 94 names->insert(e.internal_name); |
95 break; | 95 break; |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 } | 631 } |
632 | 632 |
633 std::set<std::string> new_enabled_entries = | 633 std::set<std::string> new_enabled_entries = |
634 base::STLSetIntersection<std::set<std::string>>(platform_entries, | 634 base::STLSetIntersection<std::set<std::string>>(platform_entries, |
635 *result); | 635 *result); |
636 | 636 |
637 result->swap(new_enabled_entries); | 637 result->swap(new_enabled_entries); |
638 } | 638 } |
639 | 639 |
640 } // namespace flags_ui | 640 } // namespace flags_ui |
OLD | NEW |