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

Side by Side Diff: components/error_page/common/localized_error.cc

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Rebase 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 (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 "components/error_page/common/localized_error.h" 5 #include "components/error_page/common/localized_error.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 750
751 if (header_message_id) { 751 if (header_message_id) {
752 suggestion_list_item->SetString("header", 752 suggestion_list_item->SetString("header",
753 l10n_util::GetStringUTF16(header_message_id)); 753 l10n_util::GetStringUTF16(header_message_id));
754 } 754 }
755 if (body_message_id) { 755 if (body_message_id) {
756 suggestion_list_item->SetString("body", 756 suggestion_list_item->SetString("body",
757 l10n_util::GetStringUTF16(body_message_id)); 757 l10n_util::GetStringUTF16(body_message_id));
758 } 758 }
759 list->Append(base::WrapUnique(suggestion_list_item)); 759 list->Append(base::WrapUnique(suggestion_list_item));
760 // |suggestion_list_item| is invalidated at this point, so it needs to be
761 // reset.
762 list->GetDictionary(list->GetSize() - 1, &suggestion_list_item);
760 return suggestion_list_item; 763 return suggestion_list_item;
761 } 764 }
762 765
763 // Certain suggestions have supporting details which get displayed under 766 // Certain suggestions have supporting details which get displayed under
764 // the "Details" button. 767 // the "Details" button.
765 void AddSuggestionsDetails(int error_code, 768 void AddSuggestionsDetails(int error_code,
766 base::DictionaryValue* error_strings, 769 base::DictionaryValue* error_strings,
767 int suggestions, 770 int suggestions,
768 base::ListValue* suggestions_details) { 771 base::ListValue* suggestions_details) {
769 if (suggestions & SUGGEST_CHECK_CONNECTION) { 772 if (suggestions & SUGGEST_CHECK_CONNECTION) {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 1070
1068 bool LocalizedError::HasStrings(const std::string& error_domain, 1071 bool LocalizedError::HasStrings(const std::string& error_domain,
1069 int error_code) { 1072 int error_code) {
1070 // Whether or not the there are strings for an error does not depend on 1073 // Whether or not the there are strings for an error does not depend on
1071 // whether or not the page was be generated by a POST, so just claim it was 1074 // whether or not the page was be generated by a POST, so just claim it was
1072 // not. 1075 // not.
1073 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; 1076 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr;
1074 } 1077 }
1075 1078
1076 } // namespace error_page 1079 } // namespace error_page
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698