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

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

Issue 207553008: Surface button for loading stale cache copy on net error page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Shift text to match behavior doc. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/errorpage_browsertest.cc ('k') | chrome/renderer/resources/neterror.html » ('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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 IDS_ERRORPAGES_SUGGESTION_RELOAD_REPOST_HEADER)); 662 IDS_ERRORPAGES_SUGGESTION_RELOAD_REPOST_HEADER));
663 suggest_reload_repost->SetString("body", 663 suggest_reload_repost->SetString("body",
664 l10n_util::GetStringUTF16( 664 l10n_util::GetStringUTF16(
665 IDS_ERRORPAGES_SUGGESTION_RELOAD_REPOST_BODY)); 665 IDS_ERRORPAGES_SUGGESTION_RELOAD_REPOST_BODY));
666 // Add at the front, so it appears before other suggestions, in the case 666 // Add at the front, so it appears before other suggestions, in the case
667 // suggestions are being overridden by |params|. 667 // suggestions are being overridden by |params|.
668 suggestions->Insert(0, suggest_reload_repost); 668 suggestions->Insert(0, suggest_reload_repost);
669 } 669 }
670 } 670 }
671 671
672 if (stale_copy_in_cache) {
mmenke 2014/03/26 15:06:14 I suggest putting this below use_default_suggestio
Randy Smith (Not in Mondays) 2014/03/26 20:40:12 This currently happens only in the link doctor cas
mmenke 2014/03/27 14:28:28 Yes, this is only in the Link Doctor case. This i
Randy Smith (Not in Mondays) 2014/04/02 19:20:58 Yeah, I thought about what it would take to do it
673 base::DictionaryValue* stale_load_button = new base::DictionaryValue;
674 stale_load_button->SetString(
675 "msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_STALE));
mmenke 2014/03/26 15:06:14 This subdirectory isn't needed. Instead you can j
Randy Smith (Not in Mondays) 2014/03/26 20:40:12 Done (now that I understand what's going on :-}).
676 error_strings->Set("staleCopyInCache", stale_load_button);
mmenke 2014/03/26 15:06:14 Getting the "IDS_ERRORPAGES_BUTTON_STALE" string,
Randy Smith (Not in Mondays) 2014/03/26 20:40:12 Done. Let me know if you'd like me to regularize
mmenke 2014/03/27 14:28:28 I think it'd be great if you went ahead and cleane
Randy Smith (Not in Mondays) 2014/04/02 19:20:58 I believe I've done this (just changing the templa
677 }
678
672 // If not using the default suggestions, nothing else to do. 679 // If not using the default suggestions, nothing else to do.
673 if (!use_default_suggestions) 680 if (!use_default_suggestions)
674 return; 681 return;
675 682
676 error_strings->SetBoolean("staleCopyInCache", stale_copy_in_cache);
677
678 #if defined(OS_CHROMEOS) 683 #if defined(OS_CHROMEOS)
679 error_strings->SetString( 684 error_strings->SetString(
680 "diagnose", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DIAGNOSE)); 685 "diagnose", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DIAGNOSE));
681 #endif // defined(OS_CHROMEOS) 686 #endif // defined(OS_CHROMEOS)
682 687
683 if (options.suggestions & SUGGEST_CHECK_CONNECTION) { 688 if (options.suggestions & SUGGEST_CHECK_CONNECTION) {
684 base::DictionaryValue* suggest_check_connection = new base::DictionaryValue; 689 base::DictionaryValue* suggest_check_connection = new base::DictionaryValue;
685 suggest_check_connection->SetString("header", 690 suggest_check_connection->SetString("header",
686 l10n_util::GetStringUTF16( 691 l10n_util::GetStringUTF16(
687 IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_HEADER)); 692 IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_HEADER));
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 #if defined(OS_CHROMEOS) 860 #if defined(OS_CHROMEOS)
856 GURL learn_more_url(kAppWarningLearnMoreUrl); 861 GURL learn_more_url(kAppWarningLearnMoreUrl);
857 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); 862 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue();
858 suggest_learn_more->SetString("msg", 863 suggest_learn_more->SetString("msg",
859 l10n_util::GetStringUTF16( 864 l10n_util::GetStringUTF16(
860 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); 865 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY));
861 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); 866 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec());
862 error_strings->Set("suggestionsLearnMore", suggest_learn_more); 867 error_strings->Set("suggestionsLearnMore", suggest_learn_more);
863 #endif // defined(OS_CHROMEOS) 868 #endif // defined(OS_CHROMEOS)
864 } 869 }
OLDNEW
« no previous file with comments | « chrome/browser/errorpage_browsertest.cc ('k') | chrome/renderer/resources/neterror.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698