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

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

Issue 2774203002: Migrate about:flags messages to const char* (Closed)
Patch Set: fix iOS compilation 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
« no previous file with comments | « components/flags_ui/feature_entry.cc ('k') | components/flags_ui/flags_state_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 504
505 int current_platform = GetCurrentPlatform(); 505 int current_platform = GetCurrentPlatform();
506 506
507 for (size_t i = 0; i < num_feature_entries_; ++i) { 507 for (size_t i = 0; i < num_feature_entries_; ++i) {
508 const FeatureEntry& entry = feature_entries_[i]; 508 const FeatureEntry& entry = feature_entries_[i];
509 if (skip_feature_entry.Run(entry)) 509 if (skip_feature_entry.Run(entry))
510 continue; 510 continue;
511 511
512 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 512 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue());
513 data->SetString("internal_name", entry.internal_name); 513 data->SetString("internal_name", entry.internal_name);
514 data->SetString("name", l10n_util::GetStringUTF16(entry.visible_name_id)); 514 data->SetString("name", base::StringPiece(entry.visible_name));
515 data->SetString("description", 515 data->SetString("description",
516 l10n_util::GetStringUTF16(entry.visible_description_id)); 516 base::StringPiece(entry.visible_description));
517 517
518 base::ListValue* supported_platforms = new base::ListValue(); 518 base::ListValue* supported_platforms = new base::ListValue();
519 AddOsStrings(entry.supported_platforms, supported_platforms); 519 AddOsStrings(entry.supported_platforms, supported_platforms);
520 data->Set("supported_platforms", supported_platforms); 520 data->Set("supported_platforms", supported_platforms);
521 // True if the switch is not currently passed. 521 // True if the switch is not currently passed.
522 bool is_default_value = IsDefaultValue(entry, enabled_entries); 522 bool is_default_value = IsDefaultValue(entry, enabled_entries);
523 data->SetBoolean("is_default", is_default_value); 523 data->SetBoolean("is_default", is_default_value);
524 524
525 switch (entry.type) { 525 switch (entry.type) {
526 case FeatureEntry::SINGLE_VALUE: 526 case FeatureEntry::SINGLE_VALUE:
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 state == FeatureEntry::FeatureState::ENABLED, 795 state == FeatureEntry::FeatureState::ENABLED,
796 name_to_switch_map); 796 name_to_switch_map);
797 } 797 }
798 } 798 }
799 break; 799 break;
800 } 800 }
801 } 801 }
802 } 802 }
803 803
804 } // namespace flags_ui 804 } // namespace flags_ui
OLDNEW
« no previous file with comments | « components/flags_ui/feature_entry.cc ('k') | components/flags_ui/flags_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698