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

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

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: 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);
763 return suggestion_list_item; 760 return suggestion_list_item;
764 } 761 }
765 762
766 // Certain suggestions have supporting details which get displayed under 763 // Certain suggestions have supporting details which get displayed under
767 // the "Details" button. 764 // the "Details" button.
768 void AddSuggestionsDetails(int error_code, 765 void AddSuggestionsDetails(int error_code,
769 base::DictionaryValue* error_strings, 766 base::DictionaryValue* error_strings,
770 int suggestions, 767 int suggestions,
771 base::ListValue* suggestions_details) { 768 base::ListValue* suggestions_details) {
772 if (suggestions & SUGGEST_CHECK_CONNECTION) { 769 if (suggestions & SUGGEST_CHECK_CONNECTION) {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 1067
1071 bool LocalizedError::HasStrings(const std::string& error_domain, 1068 bool LocalizedError::HasStrings(const std::string& error_domain,
1072 int error_code) { 1069 int error_code) {
1073 // Whether or not the there are strings for an error does not depend on 1070 // Whether or not the there are strings for an error does not depend on
1074 // whether or not the page was be generated by a POST, so just claim it was 1071 // whether or not the page was be generated by a POST, so just claim it was
1075 // not. 1072 // not.
1076 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; 1073 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr;
1077 } 1074 }
1078 1075
1079 } // namespace error_page 1076 } // namespace error_page
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698