Index: components/error_page/common/localized_error.cc |
diff --git a/components/error_page/common/localized_error.cc b/components/error_page/common/localized_error.cc |
index a349802f46c907ef7d78f56134a34b3a1dc18dcf..66e22c1eb17872004aee7b9a50a80633c1e9eb8a 100644 |
--- a/components/error_page/common/localized_error.cc |
+++ b/components/error_page/common/localized_error.cc |
@@ -45,23 +45,26 @@ namespace { |
const unsigned int kErrorPagesNoDetails = 0; |
static const char kRedirectLoopLearnMoreUrl[] = |
- "https://support.google.com/chrome/answer/95626"; |
+ "https://support.google.com/chrome?p=rl_error"; |
static const char kWeakDHKeyLearnMoreUrl[] = |
"https://support.google.com/chrome?p=dh_error"; |
static const int kGoogleCachedCopySuggestionType = 0; |
enum NAV_SUGGESTIONS { |
- SUGGEST_NONE = 0, |
- SUGGEST_RELOAD = 1 << 0, |
- SUGGEST_CHECK_CONNECTION = 1 << 1, |
- SUGGEST_DNS_CONFIG = 1 << 2, |
- SUGGEST_FIREWALL_CONFIG = 1 << 3, |
- SUGGEST_PROXY_CONFIG = 1 << 4, |
- SUGGEST_DISABLE_EXTENSION = 1 << 5, |
- SUGGEST_LEARNMORE = 1 << 6, |
- SUGGEST_VIEW_POLICIES = 1 << 7, |
- SUGGEST_CONTACT_ADMINISTRATOR = 1 << 8, |
- SUGGEST_UNSUPPORTED_CIPHER = 1 << 9, |
+ SUGGEST_NONE = 0, |
+ SUGGEST_RELOAD = 1 << 0, |
+ SUGGEST_CHECK_CONNECTION = 1 << 1, |
+ SUGGEST_DNS_CONFIG = 1 << 2, |
+ SUGGEST_FIREWALL_CONFIG = 1 << 3, |
+ SUGGEST_PROXY_CONFIG = 1 << 4, |
+ SUGGEST_DISABLE_EXTENSION = 1 << 5, |
+ SUGGEST_LEARNMORE = 1 << 6, |
+ SUGGEST_VIEW_POLICIES = 1 << 7, |
+ SUGGEST_CONTACT_ADMINISTRATOR = 1 << 8, |
+ SUGGEST_UNSUPPORTED_CIPHER = 1 << 9, |
+ SUGGEST_AV_CONFIG = 1 << 10, |
+ SUGGEST_OFFLINE_CHECKS = 1 << 11, |
+ SUGGEST_COMPLETE_SETUP = 1 << 12, |
}; |
struct LocalizedErrorMap { |
@@ -99,7 +102,8 @@ const LocalizedErrorMap net_error_options[] = { |
IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, |
IDS_ERRORPAGES_DETAILS_CONNECTION_CLOSED, |
- SUGGEST_RELOAD, |
+ SUGGEST_RELOAD, SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | |
+ SUGGEST_PROXY_CONFIG, |
}, |
{net::ERR_CONNECTION_RESET, |
IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
@@ -144,28 +148,28 @@ const LocalizedErrorMap net_error_options[] = { |
IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
IDS_ERRORPAGES_SUMMARY_ADDRESS_UNREACHABLE, |
IDS_ERRORPAGES_DETAILS_ADDRESS_UNREACHABLE, |
- SUGGEST_RELOAD | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG, |
+ SUGGEST_RELOAD, |
}, |
{net::ERR_NETWORK_ACCESS_DENIED, |
IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
IDS_ERRORPAGES_HEADING_NETWORK_ACCESS_DENIED, |
IDS_ERRORPAGES_SUMMARY_NETWORK_ACCESS_DENIED, |
IDS_ERRORPAGES_DETAILS_NETWORK_ACCESS_DENIED, |
- SUGGEST_FIREWALL_CONFIG, |
+ SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_AV_CONFIG, |
}, |
{net::ERR_PROXY_CONNECTION_FAILED, |
IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
IDS_ERRORPAGES_SUMMARY_PROXY_CONNECTION_FAILED, |
IDS_ERRORPAGES_DETAILS_PROXY_CONNECTION_FAILED, |
- SUGGEST_PROXY_CONFIG, |
+ SUGGEST_PROXY_CONFIG | SUGGEST_CONTACT_ADMINISTRATOR, |
}, |
{net::ERR_INTERNET_DISCONNECTED, |
IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED, |
IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED, |
- SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG, |
+ SUGGEST_OFFLINE_CHECKS, |
}, |
{net::ERR_FILE_NOT_FOUND, |
IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
@@ -249,14 +253,14 @@ const LocalizedErrorMap net_error_options[] = { |
IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR, |
- SUGGEST_NONE, |
+ SUGGEST_RELOAD, |
}, |
{net::ERR_BAD_SSL_CLIENT_AUTH_CERT, |
IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
IDS_ERRORPAGES_SUMMARY_BAD_SSL_CLIENT_AUTH_CERT, |
IDS_ERRORPAGES_DETAILS_BAD_SSL_CLIENT_AUTH_CERT, |
- SUGGEST_NONE, |
+ SUGGEST_CONTACT_ADMINISTRATOR, |
}, |
{net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY, |
IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
@@ -277,7 +281,7 @@ const LocalizedErrorMap net_error_options[] = { |
IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, |
IDS_ERRORPAGES_DETAILS_TEMPORARILY_THROTTLED, |
- SUGGEST_NONE, |
+ SUGGEST_DISABLE_EXTENSION, |
}, |
{net::ERR_BLOCKED_BY_CLIENT, |
IDS_ERRORPAGES_TITLE_BLOCKED, |
@@ -291,7 +295,7 @@ const LocalizedErrorMap net_error_options[] = { |
IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, |
IDS_ERRORPAGES_SUMMARY_NETWORK_CHANGED, |
IDS_ERRORPAGES_DETAILS_NETWORK_CHANGED, |
- SUGGEST_RELOAD | SUGGEST_CHECK_CONNECTION, |
+ SUGGEST_RELOAD, |
}, |
{net::ERR_BLOCKED_BY_ADMINISTRATOR, |
IDS_ERRORPAGES_TITLE_BLOCKED, |
@@ -305,12 +309,12 @@ const LocalizedErrorMap net_error_options[] = { |
IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
IDS_ERRORPAGES_SUMMARY_BLOCKED_ENROLLMENT_CHECK_PENDING, |
IDS_ERRORPAGES_DETAILS_BLOCKED_ENROLLMENT_CHECK_PENDING, |
- SUGGEST_CHECK_CONNECTION, |
+ SUGGEST_COMPLETE_SETUP, |
}, |
{net::ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION, |
IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
- IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, |
+ IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
IDS_ERRORPAGES_DETAILS_SSL_FALLBACK_BEYOND_MINIMUM_VERSION, |
SUGGEST_NONE, |
}, |
@@ -355,7 +359,7 @@ const LocalizedErrorMap http_error_options[] = { |
IDS_ERRORPAGES_HEADING_ACCESS_DENIED, |
IDS_ERRORPAGES_SUMMARY_FORBIDDEN, |
IDS_ERRORPAGES_DETAILS_FORBIDDEN, |
- SUGGEST_NONE, |
+ SUGGEST_RELOAD, |
}, |
{410, |
IDS_ERRORPAGES_TITLE_NOT_FOUND, |
@@ -431,7 +435,7 @@ const LocalizedErrorMap dns_probe_error_options[] = { |
IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED, |
IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED, |
- SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG, |
+ SUGGEST_OFFLINE_CHECKS, |
}, |
{error_page::DNS_PROBE_FINISHED_BAD_CONFIG, |
IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
@@ -539,6 +543,192 @@ void AddGoogleCachedCopyButton(base::ListValue* suggestions, |
} |
} |
+// Creates a list of suggestions that a user my try to resolve a particular |
+// network error. |
+void GetSummarySuggestionsList(int error_code, |
+ base::DictionaryValue* error_strings, |
+ int suggestions, |
+ const std::string& locale) { |
+ base::ListValue* suggestions_list = new base::ListValue(); |
+ error_strings->Set("suggestionsList", suggestions_list); |
+ |
+ if (suggestions & SUGGEST_CHECK_CONNECTION) { |
+ base::DictionaryValue* suggestion_list_item = new base::DictionaryValue; |
+ suggestion_list_item->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_SUMMARY)); |
+ suggestions_list->Append(suggestion_list_item); |
+ suggestions_list->AppendString(l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_SUMMARY)); |
+ } |
+ |
+ |
+ if (suggestions & SUGGEST_DNS_CONFIG && |
+ suggestions & SUGGEST_FIREWALL_CONFIG) { |
+ base::DictionaryValue* suggestion_list_item = new base::DictionaryValue; |
+ suggestion_list_item->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECK_PROXY_FIREWALL_DNS_SUMMARY)); |
+ suggestions_list->Append(suggestion_list_item); |
+ } else if (suggestions & SUGGEST_FIREWALL_CONFIG && |
+ suggestions & SUGGEST_AV_CONFIG) { |
+ base::DictionaryValue* suggestion_list_item = new base::DictionaryValue; |
+ suggestion_list_item->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECK_FIREWALL_ANTIVIRUS_SUMMARY)); |
+ suggestions_list->Append(suggestion_list_item); |
+ } else if (suggestions & SUGGEST_PROXY_CONFIG && |
+ suggestions & SUGGEST_FIREWALL_CONFIG) { |
+ base::DictionaryValue* suggestion_list_item = new base::DictionaryValue; |
+ suggestion_list_item->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECK_PROXY_FIREWALL_SUMMARY)); |
+ suggestions_list->Append(suggestion_list_item); |
+ } else if (suggestions & SUGGEST_PROXY_CONFIG) { |
+ base::DictionaryValue* suggestion_list_item = new base::DictionaryValue; |
+ suggestion_list_item->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECK_PROXY_ADDRESS_SUMMARY)); |
+ suggestions_list->Append(suggestion_list_item); |
+ } |
+ |
+ if (suggestions & SUGGEST_CONTACT_ADMINISTRATOR) { |
+ base::DictionaryValue* suggestion_list_item = new base::DictionaryValue; |
+ if (error_code == net::ERR_PROXY_CONNECTION_FAILED) { |
+ // Unprefixed suggestion which occurs in a list. |
+ suggestion_list_item->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMIN_SUMMARY)); |
+ } else { |
+ // Standalone suggestion which includes 'Try' prefix to the sentence. |
+ suggestion_list_item->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMIN_SUMMARY_WITH_PREFIX)); |
+ } |
+ suggestions_list->Append(suggestion_list_item); |
+ } |
+ |
+ if (suggestions & SUGGEST_LEARNMORE) { |
+ GURL learn_more_url; |
+ base::string16 suggestion_string; |
+ switch (error_code) { |
+ case net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY: |
+ learn_more_url = GURL(kWeakDHKeyLearnMoreUrl); |
+ suggestion_string = l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY); |
+ break; |
+ case net::ERR_TOO_MANY_REDIRECTS: |
+ learn_more_url = GURL(kRedirectLoopLearnMoreUrl); |
+ suggestion_string = l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CLEAR_COOKIES_SUMMARY); |
+ break; |
+ default: |
+ break; |
+ } |
+ |
+ if (learn_more_url.is_valid()) { |
+ // Add the language parameter to the URL. |
+ std::string query = learn_more_url.query() + "&hl=" + locale; |
+ GURL::Replacements repl; |
+ repl.SetQueryStr(query); |
+ learn_more_url = learn_more_url.ReplaceComponents(repl); |
+ |
+ base::DictionaryValue* suggestion_list_item = new base::DictionaryValue; |
+ suggestion_list_item->SetString("summary", suggestion_string); |
+ suggestion_list_item->SetString("learnMoreUrl", learn_more_url.spec()); |
+ suggestions_list->Append(suggestion_list_item); |
+ } |
+ } |
+ |
+ if (suggestions & SUGGEST_OFFLINE_CHECKS) { |
+#if defined(OS_ANDROID) or defined(OS_IOS) |
+ base::DictionaryValue* suggestion_list_item_airplane = |
+ new base::DictionaryValue; |
+ suggestion_list_item_airplane->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_TURN_OFF_AIRPLANE)); |
+ suggestions_list->Append(suggestion_list_item_airplane); |
+ |
+ base::DictionaryValue* suggestion_list_item_data = |
+ new base::DictionaryValue; |
+ suggestion_list_item_data->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_TURN_ON_DATA)); |
+ suggestions_list->Append(suggestion_list_item_data); |
+ |
+ base::DictionaryValue* suggestion_list_item_signal = |
+ new base::DictionaryValue; |
+ suggestion_list_item_signal->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECKING_SIGNAL)); |
+ suggestions_list->Append(suggestion_list_item_signal); |
+#else |
+ base::DictionaryValue* suggestion_list_item_cables = |
+ new base::DictionaryValue; |
+ suggestion_list_item_cables->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECK_CABLES_SUMMARY)); |
+ suggestions_list->Append(suggestion_list_item_cables); |
+ |
+ base::DictionaryValue* suggestion_list_item_hardware = |
+ new base::DictionaryValue; |
+ suggestion_list_item_hardware->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_RESET_HARDWARE_SUMMARY)); |
+ suggestions_list->Append(suggestion_list_item_hardware); |
+ |
+ base::DictionaryValue* suggestion_list_item_wifi = |
+ new base::DictionaryValue; |
+ suggestion_list_item_wifi->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_CHECK_WIFI_SUMMARY)); |
+ suggestions_list->Append(suggestion_list_item_wifi); |
+#endif |
+ } |
+ |
+ if (suggestions & SUGGEST_COMPLETE_SETUP) { |
+ base::DictionaryValue* suggestion_diagnose = new base::DictionaryValue; |
+ suggestion_diagnose->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_DIAGNOSE_CONNECTION_SUMMARY)); |
+ suggestions_list->Append(suggestion_diagnose); |
+ |
+ base::DictionaryValue* suggestion_complete_setup = |
+ new base::DictionaryValue; |
+ suggestion_complete_setup->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_COMPLETE_SETUP_SUMMARY)); |
+ suggestions_list->Append(suggestion_complete_setup); |
+ } |
+ |
+ if (suggestions & SUGGEST_DISABLE_EXTENSION) { |
+ base::DictionaryValue* suggest_disable_extension = |
+ new base::DictionaryValue; |
+ suggest_disable_extension->SetString("summary", |
+ l10n_util::GetStringUTF16( |
+ IDS_ERRORPAGES_SUGGESTION_DISABLE_EXTENSION_SUMMARY)); |
+ suggestions_list->Append(suggest_disable_extension); |
+ } |
+ |
+ // Only add a explicit reload suggestion if there are other suggestions. |
+ // Otherwise we rely on the reload button being used. |
+ if (suggestions_list->GetSize() > 0 && suggestions & SUGGEST_RELOAD) { |
+ base::DictionaryValue* suggestion_list_item = new base::DictionaryValue; |
+ suggestion_list_item->SetString("summary", |
+ l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_RELOAD_SUMMARY)); |
+ // Add as first item. |
+ suggestions_list->Insert(0, suggestion_list_item); |
+ } |
+ |
+ // Add list prefix header if there are suggestions except |
+ // for the 'Incomplete enrollment setup'. |
+ if (suggestions_list->GetSize() > 1 && |
+ !(suggestions & SUGGEST_COMPLETE_SETUP)) { |
+ error_strings->SetString("suggestionListHeader", |
+ l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_LIST_HEADER)); |
+ } |
+} |
+ |
} // namespace |
const char LocalizedError::kHttpErrorDomain[] = "http"; |
@@ -651,7 +841,7 @@ void LocalizedError::GetStrings(int error_code, |
error_string = base::ASCIIToUTF16(ascii_error_string); |
} else { |
DCHECK_EQ(LocalizedError::kHttpErrorDomain, error_domain); |
- error_string = base::IntToString16(error_code); |
+ error_string = base::ASCIIToUTF16(net::HttpErrorCodeToString(error_code)); |
} |
error_strings->SetString("errorCode", error_string); |
@@ -693,19 +883,25 @@ void LocalizedError::GetStrings(int error_code, |
bool use_default_suggestions = true; |
if (!params->override_suggestions) { |
suggestions = new base::ListValue(); |
+ // Detailed suggestion information. |
+ error_strings->Set("suggestions", suggestions); |
mmenke
2016/02/12 17:25:54
Erm...Using "suggestions" in some cases and "sugge
edwardjung
2016/02/15 15:53:49
Not quite, override suggestions appear above the f
|
} else { |
suggestions = params->override_suggestions.release(); |
use_default_suggestions = false; |
AddGoogleCachedCopyButton(suggestions, error_strings); |
+ error_strings->Set("suggestionsList", suggestions); |
} |
- error_strings->Set("suggestions", suggestions); |
if (params->search_url.is_valid()) { |
- error_strings->SetString("searchHeader", |
- l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_GOOGLE_SEARCH)); |
- error_strings->SetString("searchUrl", params->search_url.spec()); |
- error_strings->SetString("searchTerms", params->search_terms); |
- error_strings->SetInteger("searchTrackingId", params->search_tracking_id); |
+ base::DictionaryValue* suggestion_search = new base::DictionaryValue; |
mmenke
2016/02/12 17:25:54
search_suggestion?
edwardjung
2016/02/15 15:53:49
Done.
|
+ suggestion_search->SetString("summary", |
+ l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_GOOGLE_SEARCH)); |
+ suggestion_search->SetString("searchUrl", params->search_url.spec() + |
+ params->search_terms); |
+ suggestion_search->SetString("searchTerms", params->search_terms); |
+ suggestion_search->SetInteger("trackingId", |
+ params->search_tracking_id); |
+ suggestions->Append(suggestion_search); |
} |
// Add the reload suggestion, if needed. |
@@ -738,6 +934,9 @@ void LocalizedError::GetStrings(int error_code, |
// If not using the default suggestions, nothing else to do. |
if (!use_default_suggestions) |
return; |
+ else |
+ GetSummarySuggestionsList(error_code, error_strings, |
+ options.suggestions, locale); |
mmenke
2016/02/12 17:25:54
This code is just too confusing. I'm really havin
mmenke
2016/02/12 17:25:54
Use braces
edwardjung
2016/02/15 15:53:49
Done.
edwardjung
2016/02/15 15:53:49
Valid point. I've moved the suggestions details in
|
const std::string& show_saved_copy_value = |
command_line->GetSwitchValueASCII(error_page::switches::kShowSavedCopy); |
@@ -863,16 +1062,6 @@ void LocalizedError::GetStrings(int error_code, |
suggestions->Append(suggest_proxy_config); |
} |
- if (options.suggestions & SUGGEST_DISABLE_EXTENSION) { |
- base::DictionaryValue* suggest_disable_extension = |
- new base::DictionaryValue; |
- // There's only a header for this suggestion. |
- suggest_disable_extension->SetString("header", |
- l10n_util::GetStringUTF16( |
- IDS_ERRORPAGES_SUGGESTION_DISABLE_EXTENSION_HEADER)); |
- suggestions->Append(suggest_disable_extension); |
- } |
- |
if (options.suggestions & SUGGEST_VIEW_POLICIES) { |
base::DictionaryValue* suggest_view_policies = new base::DictionaryValue; |
suggest_view_policies->SetString( |
@@ -886,45 +1075,6 @@ void LocalizedError::GetStrings(int error_code, |
suggestions->Append(suggest_view_policies); |
} |
- if (options.suggestions & SUGGEST_CONTACT_ADMINISTRATOR) { |
- base::DictionaryValue* suggest_contant_administrator = |
- new base::DictionaryValue; |
- suggest_contant_administrator->SetString( |
- "body", |
- l10n_util::GetStringUTF16( |
- IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMINISTRATOR_BODY)); |
- suggestions->Append(suggest_contant_administrator); |
- } |
- |
- if (options.suggestions & SUGGEST_LEARNMORE) { |
- GURL learn_more_url; |
- switch (options.error_code) { |
- case net::ERR_TOO_MANY_REDIRECTS: |
- learn_more_url = GURL(kRedirectLoopLearnMoreUrl); |
- break; |
- case net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY: |
- learn_more_url = GURL(kWeakDHKeyLearnMoreUrl); |
- break; |
- default: |
- break; |
- } |
- |
- if (learn_more_url.is_valid()) { |
- // Add the language parameter to the URL. |
- std::string query = learn_more_url.query() + "&hl=" + locale; |
- GURL::Replacements repl; |
- repl.SetQueryStr(query); |
- learn_more_url = learn_more_url.ReplaceComponents(repl); |
- |
- base::DictionaryValue* suggest_learn_more = new base::DictionaryValue; |
- // There's only a body for this suggestion. |
- suggest_learn_more->SetString("body", |
- l10n_util::GetStringUTF16(IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); |
- suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
- suggestions->Append(suggest_learn_more); |
- } |
- } |
- |
if (options.suggestions & SUGGEST_UNSUPPORTED_CIPHER) { |
base::DictionaryValue* suggest_unsupported_cipher = |
new base::DictionaryValue; |