From 1f94cba94f9d3feefb062885387b64ac22f40da3 Mon Sep 17 00:00:00 2001 From: "rdsmith@chromium.org" Date: Tue, 5 Aug 2014 14:35:25 +0000 Subject: Shift the error page "More" button over to text and float to side. Note that this also involved copying neterror.css/js over to chrome/browser/resources/ssl so as to break the dependency between blocking.html in that directory and the css/js files in chrome/renderer/resources. That copy means that, while I'm going through presubmit errors before uploading, I"m not fixing them all-- there are pre-existing errors in neterror.css that I don't have the expertise to fix. BUG=None Review URL: https://codereview.chromium.org/422933002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287538 0039d316-1c4b-4281-b951-d872f2087c98 --- build/ios/grit_whitelist.txt | 2 + chrome/app/generated_resources.grd | 6 ++ chrome/browser/errorpage_browsertest.cc | 2 +- chrome/common/localized_error.cc | 5 +- chrome/renderer/net/net_error_page_controller.cc | 5 +- chrome/renderer/net/net_error_page_controller.h | 4 +- chrome/renderer/resources/neterror.css | 87 +++++++++++++++++------- chrome/renderer/resources/neterror.html | 33 +++++---- chrome/renderer/resources/neterror.js | 62 ++++++++++------- 9 files changed, 136 insertions(+), 70 deletions(-) diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt index c55ad9af..32c8ca7 100644 --- a/build/ios/grit_whitelist.txt +++ b/build/ios/grit_whitelist.txt @@ -327,6 +327,8 @@ IDS_ERRORPAGES_HEADING_SSL_PROTOCOL_ERROR IDS_ERRORPAGES_HEADING_TOO_MANY_REDIRECTS IDS_ERRORPAGES_HEADING_WEAK_SERVER_EPHEMERAL_DH_KEY IDS_ERRORPAGES_HTTP_POST_WARNING +IDS_ERRORPAGES_NET_BUTTON_DETAILS +IDS_ERRORPAGES_NET_BUTTON_HIDE_DETAILS IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_BODY IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_HEADER IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMINISTRATOR diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index e203d04..3b0f328 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -8537,6 +8537,12 @@ Keep your key file in a safe place. You will need it to create new versions of y + + Details + + + Hide details + More diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc index 1d676a9..820f51c 100644 --- a/chrome/browser/errorpage_browsertest.cc +++ b/chrome/browser/errorpage_browsertest.cc @@ -80,7 +80,7 @@ bool WARN_UNUSED_RESULT IsDisplayingText(Browser* browser, void ToggleHelpBox(Browser* browser) { EXPECT_TRUE(content::ExecuteScript( browser->tab_strip_model()->GetActiveWebContents(), - "document.getElementById('more-less-button').click();")); + "document.getElementById('details-button').click();")); } // Returns true if |browser| is displaying the text representation of diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc index ecff88f..63bf219 100644 --- a/chrome/common/localized_error.cc +++ b/chrome/common/localized_error.cc @@ -565,9 +565,10 @@ void LocalizedError::GetStrings(int error_code, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); error_strings->SetString( - "more", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_MORE)); + "details", l10n_util::GetStringUTF16(IDS_ERRORPAGE_NET_BUTTON_DETAILS)); error_strings->SetString( - "less", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_LESS)); + "hideDetails", l10n_util::GetStringUTF16( + IDS_ERRORPAGE_NET_BUTTON_HIDE_DETAILS)); error_strings->Set("summary", summary); if (options.details_resource_id != kErrorPagesNoDetails) { diff --git a/chrome/renderer/net/net_error_page_controller.cc b/chrome/renderer/net/net_error_page_controller.cc index 42a2c20..fcdbfab 100644 --- a/chrome/renderer/net/net_error_page_controller.cc +++ b/chrome/renderer/net/net_error_page_controller.cc @@ -60,7 +60,7 @@ bool NetErrorPageController::ReloadButtonClick() { return true; } -bool NetErrorPageController::MoreButtonClick() { +bool NetErrorPageController::DetailsButtonClick() { if (!render_frame()) return false; @@ -99,7 +99,8 @@ gin::ObjectTemplateBuilder NetErrorPageController::GetObjectTemplateBuilder( &NetErrorPageController::LoadStaleButtonClick) .SetMethod("reloadButtonClick", &NetErrorPageController::ReloadButtonClick) - .SetMethod("moreButtonClick", &NetErrorPageController::MoreButtonClick) + .SetMethod("detailsButtonClick", + &NetErrorPageController::DetailsButtonClick) .SetMethod("trackClick", &NetErrorPageController::TrackClick); } diff --git a/chrome/renderer/net/net_error_page_controller.h b/chrome/renderer/net/net_error_page_controller.h index 9c5314a..9be5bf4 100644 --- a/chrome/renderer/net/net_error_page_controller.h +++ b/chrome/renderer/net/net_error_page_controller.h @@ -36,8 +36,8 @@ class NetErrorPageController // Execute a "Reload" button click. bool ReloadButtonClick(); - // Execute a "More" button click. - bool MoreButtonClick(); + // Execute a "Details" button click. + bool DetailsButtonClick(); // Track a click when the page has suggestions from the navigation correction // service. diff --git a/chrome/renderer/resources/neterror.css b/chrome/renderer/resources/neterror.css index fc2e153..da9ffcc 100644 --- a/chrome/renderer/resources/neterror.css +++ b/chrome/renderer/resources/neterror.css @@ -2,13 +2,6 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/******************************************************************************* - * - * Note: This is also used by a file in chrome/browser/resources/ssl. When - * updating this file, make sure nothing in that directory regresses. - * - ******************************************************************************/ - body { background-color: #E6E6E6; font-family: Helvetica, Arial, sans-serif; @@ -45,18 +38,18 @@ html:not([subframe]) #sub-frame-error { } #diagnose-button { - margin-top: 20px; + -webkit-margin-start: 0; margin-bottom: 10px; - -webkit-margin-start: 0px; + margin-top: 20px; } #content-top #buttons, #content-top h1 { color: #666; - margin: 10px 0px 30px 0px; - font-weight: normal; font-size: 1.5em; + font-weight: normal; text-align: center; + margin: 10px 0 30px; } h2 { @@ -67,7 +60,7 @@ h2 { } a { - color: #15c; + color: rgb(17, 85, 204); text-decoration: none; } @@ -96,8 +89,8 @@ a { } #help-box-outer { - overflow: hidden; -webkit-transition: height ease-in 218ms; + overflow: hidden; } #help-box-inner { @@ -129,10 +122,10 @@ a { } button { + -webkit-user-select: none; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2px; color: #444; - -webkit-user-select: none; /* iOS does not support linear-gradient without a prefix. */ background-image: -webkit-linear-gradient(#ededed, #ededed 38%, #dedede); @@ -145,7 +138,8 @@ button { /* Not done on mobile for performance reasons. */ - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.75); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), + inset 0 1px 2px rgba(255, 255, 255, 0.75); } @@ -159,7 +153,8 @@ button:hover { background-color: #f0f0f0; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.95); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), + inset 0 1px 2px rgba(255, 255, 255, 0.95); } @@ -178,7 +173,7 @@ button:active { } .text-button { - margin: 0px 5px; + margin: 0 5px; min-height: 29px; min-width: 65px; padding: 7px 13px; @@ -196,7 +191,8 @@ button:active { border: 1px solid rgb(0, 152, 206); - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.2); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), + inset 0 1px 2px rgba(255, 255, 255, 0.2); } @@ -207,7 +203,8 @@ button:active { border: 1px solid rgba(45, 102, 195, 1); - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.2); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), + inset 0 1px 2px rgba(255, 255, 255, 0.2); } @@ -240,20 +237,20 @@ button:active { } #search-box:focus { - border: 1px solid #5d9aff; + border: 1px solid rgb(93, 154, 255); outline: none; } #search-button { border: none; - border-top-left-radius: 0; border-bottom-left-radius: 0; + border-top-left-radius: 0; box-shadow: none; display: flex; height: 30px; margin: 0; - width: 60px; padding: 0; + width: 60px; } #search-image { @@ -299,7 +296,7 @@ button:active { margin: 15px; } h1 { - margin: 10px 0px 15px 0px; + margin: 10px 0 15px; } #content-top { margin: 15px; @@ -311,7 +308,7 @@ button:active { margin-top: 10px; } .suggestion-header { - margin-bottom: 0px; + margin-bottom: 0; } .error-code { margin-top: 10px; @@ -330,9 +327,9 @@ html[subframe] body { -webkit-flex-flow: column; height: 100%; -webkit-justify-content: center; - left: 0px; + left: 0; position: absolute; - top: 0px; + top: 0; width: 100%; } @@ -357,3 +354,41 @@ html[subframe] body { display: none; } } + +/* details-button is special; it's a - - +
+ + +
+