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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
503 | 503 |
504 int current_platform = GetCurrentPlatform(); | 504 int current_platform = GetCurrentPlatform(); |
505 | 505 |
506 for (size_t i = 0; i < num_feature_entries_; ++i) { | 506 for (size_t i = 0; i < num_feature_entries_; ++i) { |
507 const FeatureEntry& entry = feature_entries_[i]; | 507 const FeatureEntry& entry = feature_entries_[i]; |
508 if (skip_feature_entry.Run(entry)) | 508 if (skip_feature_entry.Run(entry)) |
509 continue; | 509 continue; |
510 | 510 |
511 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 511 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
512 data->SetString("internal_name", entry.internal_name); | 512 data->SetString("internal_name", entry.internal_name); |
513 data->SetString("name", l10n_util::GetStringUTF16(entry.visible_name_id)); | 513 data->SetString("name", |
514 data->SetString("description", | 514 base::UTF8ToUTF16(base::StringPiece(entry.visible_name))); |
Alexei Svitkine (slow)
2017/03/27 16:37:29
Looks like SetString() accepts a StringPiece as th
vabr (Chromium)
2017/03/27 18:12:33
Thanks for catching this, it would have been indee
| |
515 l10n_util::GetStringUTF16(entry.visible_description_id)); | 515 data->SetString( |
516 "description", | |
517 base::UTF8ToUTF16(base::StringPiece(entry.visible_description))); | |
516 | 518 |
517 base::ListValue* supported_platforms = new base::ListValue(); | 519 base::ListValue* supported_platforms = new base::ListValue(); |
518 AddOsStrings(entry.supported_platforms, supported_platforms); | 520 AddOsStrings(entry.supported_platforms, supported_platforms); |
519 data->Set("supported_platforms", supported_platforms); | 521 data->Set("supported_platforms", supported_platforms); |
520 // True if the switch is not currently passed. | 522 // True if the switch is not currently passed. |
521 bool is_default_value = IsDefaultValue(entry, enabled_entries); | 523 bool is_default_value = IsDefaultValue(entry, enabled_entries); |
522 data->SetBoolean("is_default", is_default_value); | 524 data->SetBoolean("is_default", is_default_value); |
523 | 525 |
524 switch (entry.type) { | 526 switch (entry.type) { |
525 case FeatureEntry::SINGLE_VALUE: | 527 case FeatureEntry::SINGLE_VALUE: |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
794 state == FeatureEntry::FeatureState::ENABLED, | 796 state == FeatureEntry::FeatureState::ENABLED, |
795 name_to_switch_map); | 797 name_to_switch_map); |
796 } | 798 } |
797 } | 799 } |
798 break; | 800 break; |
799 } | 801 } |
800 } | 802 } |
801 } | 803 } |
802 | 804 |
803 } // namespace flags_ui | 805 } // namespace flags_ui |
OLD | NEW |