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

Side by Side Diff: chrome/common/localized_error.cc

Issue 601523003: Network error interstitial bug fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix blue button flash when page loads Created 6 years, 2 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 | « no previous file | chrome/renderer/resources/neterror.css » ('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 (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 "chrome/common/localized_error.h" 5 #include "chrome/common/localized_error.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 l10n_util::GetStringFUTF16(options.title_resource_id, failed_url_string)); 552 l10n_util::GetStringFUTF16(options.title_resource_id, failed_url_string));
553 error_strings->SetString("heading", 553 error_strings->SetString("heading",
554 l10n_util::GetStringUTF16(options.heading_resource_id)); 554 l10n_util::GetStringUTF16(options.heading_resource_id));
555 555
556 std::string icon_class = GetIconClassForError(error_domain, error_code); 556 std::string icon_class = GetIconClassForError(error_domain, error_code);
557 error_strings->SetString("iconClass", icon_class); 557 error_strings->SetString("iconClass", icon_class);
558 558
559 base::DictionaryValue* summary = new base::DictionaryValue; 559 base::DictionaryValue* summary = new base::DictionaryValue;
560 560
561 // For offline show a summary message underneath the heading. 561 // For offline show a summary message underneath the heading.
562 if (error_code == net::ERR_INTERNET_DISCONNECTED) { 562 if (error_code == net::ERR_INTERNET_DISCONNECTED ||
563 error_code == chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET) {
563 error_strings->SetString("primaryParagraph", 564 error_strings->SetString("primaryParagraph",
564 l10n_util::GetStringUTF16(options.summary_resource_id)); 565 l10n_util::GetStringUTF16(options.summary_resource_id));
565 } else { 566 } else {
566 // Set summary message in the details. 567 // Set summary message in the details.
567 summary->SetString("msg", 568 summary->SetString("msg",
568 l10n_util::GetStringUTF16(options.summary_resource_id)); 569 l10n_util::GetStringUTF16(options.summary_resource_id));
569 } 570 }
570 summary->SetString("failedUrl", failed_url_string); 571 summary->SetString("failedUrl", failed_url_string);
571 summary->SetString("hostName", net::IDNToUnicode(failed_url.host(), 572 summary->SetString("hostName", net::IDNToUnicode(failed_url.host(),
572 accept_languages)); 573 accept_languages));
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 #if defined(OS_CHROMEOS) 875 #if defined(OS_CHROMEOS)
875 GURL learn_more_url(kAppWarningLearnMoreUrl); 876 GURL learn_more_url(kAppWarningLearnMoreUrl);
876 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); 877 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue();
877 suggest_learn_more->SetString("msg", 878 suggest_learn_more->SetString("msg",
878 l10n_util::GetStringUTF16( 879 l10n_util::GetStringUTF16(
879 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); 880 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY));
880 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); 881 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec());
881 error_strings->Set("suggestionsLearnMore", suggest_learn_more); 882 error_strings->Set("suggestionsLearnMore", suggest_learn_more);
882 #endif // defined(OS_CHROMEOS) 883 #endif // defined(OS_CHROMEOS)
883 } 884 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/resources/neterror.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698