| OLD | NEW |
| 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 AddSingleEntryDictionaryToList(suggestions_summary_list, "summary", | 627 AddSingleEntryDictionaryToList(suggestions_summary_list, "summary", |
| 628 IDS_ERRORPAGES_SUGGESTION_RELOAD_REPOST_SUMMARY, false); | 628 IDS_ERRORPAGES_SUGGESTION_RELOAD_REPOST_SUMMARY, false); |
| 629 return; | 629 return; |
| 630 } | 630 } |
| 631 DCHECK(!IsSuggested(suggestions, SUGGEST_REPOST_RELOAD)); | 631 DCHECK(!IsSuggested(suggestions, SUGGEST_REPOST_RELOAD)); |
| 632 | 632 |
| 633 if (IsOnlySuggestion(suggestions, SUGGEST_NAVIGATE_TO_ORIGIN)) { | 633 if (IsOnlySuggestion(suggestions, SUGGEST_NAVIGATE_TO_ORIGIN)) { |
| 634 DCHECK(suggestions_summary_list->empty()); | 634 DCHECK(suggestions_summary_list->empty()); |
| 635 DCHECK(!(suggestions & ~SUGGEST_NAVIGATE_TO_ORIGIN)); | 635 DCHECK(!(suggestions & ~SUGGEST_NAVIGATE_TO_ORIGIN)); |
| 636 url::Origin failed_origin(failed_url); | 636 url::Origin failed_origin(failed_url); |
| 637 if (failed_origin.unique()) | 637 if (failed_origin.opaque()) |
| 638 return; | 638 return; |
| 639 | 639 |
| 640 auto suggestion = base::MakeUnique<base::DictionaryValue>(); | 640 auto suggestion = base::MakeUnique<base::DictionaryValue>(); |
| 641 suggestion->SetString("summary", | 641 suggestion->SetString("summary", |
| 642 l10n_util::GetStringUTF16( | 642 l10n_util::GetStringUTF16( |
| 643 IDS_ERRORPAGES_SUGGESTION_NAVIGATE_TO_ORIGIN)); | 643 IDS_ERRORPAGES_SUGGESTION_NAVIGATE_TO_ORIGIN)); |
| 644 suggestion->SetString("originURL", failed_origin.Serialize()); | 644 suggestion->SetString("originURL", failed_origin.Serialize()); |
| 645 suggestions_summary_list->Append(std::move(suggestion)); | 645 suggestions_summary_list->Append(std::move(suggestion)); |
| 646 return; | 646 return; |
| 647 } | 647 } |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 | 1067 |
| 1068 bool LocalizedError::HasStrings(const std::string& error_domain, | 1068 bool LocalizedError::HasStrings(const std::string& error_domain, |
| 1069 int error_code) { | 1069 int error_code) { |
| 1070 // 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 |
| 1071 // 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 |
| 1072 // not. | 1072 // not. |
| 1073 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; | 1073 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; |
| 1074 } | 1074 } |
| 1075 | 1075 |
| 1076 } // namespace error_page | 1076 } // namespace error_page |
| OLD | NEW |