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

Unified Diff: components/security_interstitials/core/browser/resources/interstitial_large.js

Issue 2930043002: Implement V2 design for quiet safe browsing interstitial (Closed)
Patch Set: Remove extra break Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/security_interstitials/core/browser/resources/interstitial_large.js
diff --git a/components/security_interstitials/core/browser/resources/interstitial_large.js b/components/security_interstitials/core/browser/resources/interstitial_large.js
index 54b7d362c49eeb7a9641639b36274e7ad2bea6b7..3deac633c8a79323c33a76bc3e595f8b3b2c558c 100644
--- a/components/security_interstitials/core/browser/resources/interstitial_large.js
+++ b/components/security_interstitials/core/browser/resources/interstitial_large.js
@@ -56,7 +56,7 @@ function appendDebuggingField(title, value, fixedWidth) {
}
function toggleDebuggingInfo() {
- $('error-debugging-info').classList.toggle('hidden');
+ $('error-debugging-info').classList.toggle(HIDDEN_CLASS);
}
function setupEvents() {
@@ -70,7 +70,7 @@ function setupEvents() {
if (ssl) {
$('body').classList.add(badClock ? 'bad-clock' : 'ssl');
$('error-code').textContent = loadTimeData.getString('errorCode');
- $('error-code').classList.remove('hidden');
+ $('error-code').classList.remove(HIDDEN_CLASS);
} else if (captivePortal) {
$('body').classList.add('captive-portal');
} else {
@@ -80,7 +80,7 @@ function setupEvents() {
$('icon').classList.add('icon');
if (hidePrimaryButton) {
- $('primary-button').classList.add('hidden');
+ $('primary-button').classList.add(HIDDEN_CLASS);
} else {
$('primary-button').addEventListener('click', function() {
switch (interstitialType) {
@@ -113,7 +113,7 @@ function setupEvents() {
sendCommand(SecurityInterstitialCommandId.CMD_PROCEED);
});
} else if (!ssl) {
- $('final-paragraph').classList.add('hidden');
+ $('final-paragraph').classList.add(HIDDEN_CLASS);
}
if (ssl && overridable) {
@@ -137,13 +137,13 @@ function setupEvents() {
$('details-button').classList.add('hidden');
} else {
$('details-button').addEventListener('click', function(event) {
- var hiddenDetails = $('details').classList.toggle('hidden');
+ var hiddenDetails = $('details').classList.toggle(HIDDEN_CLASS);
if (mobileNav) {
// Details appear over the main content on small screens.
- $('main-content').classList.toggle('hidden', !hiddenDetails);
+ $('main-content').classList.toggle(HIDDEN_CLASS, !hiddenDetails);
} else {
- $('main-content').classList.remove('hidden');
+ $('main-content').classList.remove(HIDDEN_CLASS);
}
$('details-button').innerText = hiddenDetails ?
@@ -163,15 +163,7 @@ function setupEvents() {
});
}
- document.addEventListener('click', function(e) {
- var anchor = findAncestor(/** @type {Node} */ (e.target), function(el) {
- return el.tagName == 'A';
- });
- // Use getAttribute() to prevent URL normalization.
- if (anchor && anchor.getAttribute('href') == '#')
- e.preventDefault();
- });
-
+ preventDefaultOnPoundLinkClicks();
setupExtendedReportingCheckbox();
setupSSLDebuggingInfo();
document.addEventListener('keypress', handleKeypress);

Powered by Google App Engine
This is Rietveld 408576698