Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: components/flags_ui/flags_state.cc

Issue 2774203002: Migrate about:flags messages to const char* (Closed)
Patch Set: Comments addressed Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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", base::StringPiece(entry.visible_name));
514 data->SetString("description", 514 data->SetString("description",
515 l10n_util::GetStringUTF16(entry.visible_description_id)); 515 base::StringPiece(entry.visible_description));
516 516
517 base::ListValue* supported_platforms = new base::ListValue(); 517 base::ListValue* supported_platforms = new base::ListValue();
518 AddOsStrings(entry.supported_platforms, supported_platforms); 518 AddOsStrings(entry.supported_platforms, supported_platforms);
519 data->Set("supported_platforms", supported_platforms); 519 data->Set("supported_platforms", supported_platforms);
520 // True if the switch is not currently passed. 520 // True if the switch is not currently passed.
521 bool is_default_value = IsDefaultValue(entry, enabled_entries); 521 bool is_default_value = IsDefaultValue(entry, enabled_entries);
522 data->SetBoolean("is_default", is_default_value); 522 data->SetBoolean("is_default", is_default_value);
523 523
524 switch (entry.type) { 524 switch (entry.type) {
525 case FeatureEntry::SINGLE_VALUE: 525 case FeatureEntry::SINGLE_VALUE:
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 state == FeatureEntry::FeatureState::ENABLED, 794 state == FeatureEntry::FeatureState::ENABLED,
795 name_to_switch_map); 795 name_to_switch_map);
796 } 796 }
797 } 797 }
798 break; 798 break;
799 } 799 }
800 } 800 }
801 } 801 }
802 802
803 } // namespace flags_ui 803 } // namespace flags_ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698