Chromium Code Reviews| Index: chrome/browser/resources/ntp4/md_incognito_tab.html |
| diff --git a/chrome/browser/resources/ntp4/md_incognito_tab.html b/chrome/browser/resources/ntp4/md_incognito_tab.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7f46c7d5ca554886c074f3fa54fca549dae4abe4 |
| --- /dev/null |
| +++ b/chrome/browser/resources/ntp4/md_incognito_tab.html |
| @@ -0,0 +1,74 @@ |
| +<!doctype html> |
| +<html i18n-values="dir:textdirection; |
|
Dan Beam
2017/04/11 00:31:12
don't use i18n-values, but use $i18n{} and $i18nRa
msramek
2017/04/11 19:04:27
Done.
For the record, the majority of this file i
|
| + hascustombackground:hasCustomBackground; |
| + bookmarkbarattached:bookmarkbarattached; |
| + lang:language"> |
| +<head> |
| +<meta charset="utf-8"> |
| +<title i18n-content="title"></title> |
| +<meta name="viewport" content="width=device-width"> |
| +<link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> |
| +<link rel="stylesheet" href="md_incognito_tab.css"> |
| +<script> |
| +// Until themes can clear the cache, force-reload the theme stylesheet. |
| +document.write('<link id="incognitothemecss" rel="stylesheet" ' + |
| + 'href="chrome://theme/css/incognito_new_tab_theme.css?' + |
| + Date.now() + '">'); |
| +</script> |
| +</head> |
| +<body> |
| +<div class="content"> |
| + <div class="icon"></div> |
| + <h1 i18n-content="incognitoTabHeading"></h1> |
| + <p id="subtitle"> |
| + <span i18n-content="incognitoTabDescription"></span> |
| + <a class="learn-more-button" i18n-content="learnMore" |
| + i18n-values=".href:learnMoreLink"></a> |
| + </p> |
| + <div> |
| + <div id="firstBulletpoints" class="bulletpoints" |
| + i18n-values=".innerHTML:incognitoTabFeatures"></div> |
| + <div id="secondBulletpoints" class="bulletpoints" |
| + i18n-values=".innerHTML:incognitoTabWarning"></div> |
| + <div class="clearer"></div> |
| + </div> |
| + <a class="learn-more-button" i18n-content="learnMore" |
| + i18n-values=".href:learnMoreLink"></a> |
| +</div> |
| +</body> |
| +<script src="chrome://resources/js/cr.js"></script> |
| +<script> |
|
Dan Beam
2017/04/11 00:31:12
prefer not to use inline scripts, it violates some
msramek
2017/04/11 19:04:27
Done. Extracted to a new file.
|
| +cr.define('ntp', function() { |
| + 'use strict'; |
| + /** |
| + * Set whether the bookmarks bar is attached or not. |
| + * @param {boolean} attached Whether the bar is attached or not. |
| + */ |
| + function setBookmarkBarAttached(attached) { |
| + document.documentElement.setAttribute('bookmarkbarattached', !!attached); |
| + } |
| + |
| + /** @param {!{hasCustomBackground: boolean}} themeData */ |
| + function themeChanged(themeData) { |
| + document.documentElement.setAttribute('hascustombackground', |
| + themeData.hasCustomBackground); |
| + document.getElementById('incognitothemecss').href = |
|
Dan Beam
2017/04/11 00:31:12
can you use $() instead of document.getElementById
msramek
2017/04/11 19:04:27
Done, but including util.js for a one-line method
|
| + 'chrome://theme/css/incognito_new_tab_theme.css?' + Date.now(); |
| + } |
| + |
| + return { |
| + setBookmarkBarAttached: setBookmarkBarAttached, |
| + themeChanged: themeChanged, |
| + }; |
| +}); |
| + |
| +window.addEventListener('load', function() { |
| + /* Let the width of two lists of bulletpoints in a horizontal alignment |
| + * determine the maximum content width. */ |
| + var b1 = document.getElementById("firstBulletpoints"); |
| + var b2 = document.getElementById("secondBulletpoints"); |
| + var c = document.querySelector(".content") |
| + c.style.maxWidth = (b1.offsetWidth + b2.offsetWidth + 40 /* margin */) + "px"; |
| +}); |
| +</script> |
| +</html> |