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

Unified Diff: chrome/browser/resources/security_warnings/interstitial_v2_mobile.js

Issue 865943002: Update SSL/malware/net error interstitial design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix hidden buttons on offline interstitial on CrOS Created 5 years, 11 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: chrome/browser/resources/security_warnings/interstitial_v2_mobile.js
diff --git a/chrome/browser/resources/security_warnings/interstitial_v2_mobile.js b/chrome/browser/resources/security_warnings/interstitial_v2_mobile.js
new file mode 100644
index 0000000000000000000000000000000000000000..1e08bbaf0b5e69d5baac7eff8d0b0bf439ecaa18
--- /dev/null
+++ b/chrome/browser/resources/security_warnings/interstitial_v2_mobile.js
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var mobileNav = false;
+
+/**
+ * For small screen mobile the navigation buttons are moved
+ * below the advanced text.
+ */
+function onResize() {
+ var helpOuterBox = document.querySelector('#details');
+ var mainContent = document.querySelector('#main-content');
+ var mainFrame = document.querySelector('.interstitial-wrapper');
+ var navWrapper = document.querySelector('.nav-wrapper');
+
+ var mediaQuery = '(max-width: 420px) and (orientation:portrait),' +
+ '(max-width: 736px) and (max-height: 420px) and (orientation:landscape)';
+
+ if (window.matchMedia(mediaQuery).matches) {
+ if (navWrapper.parentNode != document.body) {
+ document.body.insertBefore(navWrapper, mainFrame.nextSibling);
+ mobileNav = true;
+ }
+ } else if (navWrapper.parentNode != mainContent) {
+ mainContent.appendChild(navWrapper);
+ mobileNav = false;
+ }
+}
+
+function setupMobileNav() {
+ window.addEventListener('resize', onResize);
+ onResize();
+}
+
+document.addEventListener('DOMContentLoaded', setupMobileNav);

Powered by Google App Engine
This is Rietveld 408576698