diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 06:05:31 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 06:05:31 +0000 |
commit | b924ae04055aa82cd19ef522b690e3cd66352c11 (patch) | |
tree | 57965f3e4c027e3ee9139a3088b9950e928af59e /chrome/browser/resources | |
parent | 9c62e1c9607ca2912899660c517af6aa4b4ab477 (diff) | |
download | chromium_src-b924ae04055aa82cd19ef522b690e3cd66352c11.zip chromium_src-b924ae04055aa82cd19ef522b690e3cd66352c11.tar.gz chromium_src-b924ae04055aa82cd19ef522b690e3cd66352c11.tar.bz2 |
Revert 57473 and 57476. Best. Programmer. Ever.
TBR=eroman@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/new_new_tab.css | 81 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.html | 33 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 16 | ||||
-rw-r--r-- | chrome/browser/resources/new_tab_theme.css | 33 | ||||
-rw-r--r-- | chrome/browser/resources/ntp/apps.css | 3 | ||||
-rw-r--r-- | chrome/browser/resources/ntp/apps.js | 20 | ||||
-rw-r--r-- | chrome/browser/resources/ntp/ntp_disclosure_triangle.png | bin | 195 -> 0 bytes |
7 files changed, 118 insertions, 68 deletions
diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css index fe76ed2..80d991c 100644 --- a/chrome/browser/resources/new_new_tab.css +++ b/chrome/browser/resources/new_new_tab.css @@ -18,9 +18,10 @@ html[mode=app-launcher] { #main { -webkit-box-sizing: border-box; -webkit-transition: width .15s; + background: url(chrome://theme/IDR_PRODUCT_LOGO) no-repeat 0 6px; margin: 0 auto; min-height: 100%; - padding:10px 0 20px; + padding-bottom: 25px; /* Make room for the bottom positioned footer. */ position: relative; width: 920px; } @@ -214,10 +215,6 @@ html[dir=rtl] .item { max-width: none !important; } -#most-visited { - margin-bottom: 20px; -} - .nav > a { /* no icon */ padding: 0; @@ -248,6 +245,12 @@ html[dir=rtl] .item { margin: 0 10px; } +#top-bar { + display: -webkit-box; + -webkit-box-align: center; + min-height: 56px; +} + .notification.hidden { opacity: 0; pointer-events: none; @@ -337,6 +340,11 @@ html[dir=rtl] #option-menu > [command=hide]:before { font-family: inherit; } +#apps-section { + padding: 10px 0px; + border-top: 0; +} + #apps-launch-control { margin-top: 10px; } @@ -360,37 +368,29 @@ html[dir=rtl] #option-menu > [command=hide]:before { display: none !important; } +.section + :not(.hidden) { + border-top: 0; +} + .section > div { margin-bottom: 10px; } .section > h2 { - background-position: 0 center; - background-repeat: no-repeat; - -webkit-background-size: 100% 26px; + display: inline-block; + margin: 0; + font-size: 100%; cursor: pointer; - display: block; - font-family: Helvetica, Arial, sans-serif; - font-size: 16px; - font-weight: normal; - margin:10px 0; - -webkit-margin-collapse: separate; -} - -.section > h2 > img { - margin-left:-13px; - padding-right:4px; -} - -.section:not(.hidden) > h2 > img { - -webkit-transform:rotate(90deg); + margin-top: 10px; + margin-bottom: 10px; } -.section > h2 > span { - padding-right: 4px; +.section > h2:hover { + text-decoration: underline; } .section.hidden { + display: inline; border: 0; } @@ -398,6 +398,10 @@ html[dir=rtl] #option-menu > [command=hide]:before { display: none !important; } +.section > h2 { + margin-right: 5px; +} + .section.hidden > h2 { margin-right: 0px; } @@ -406,6 +410,10 @@ html[dir=rtl] #option-menu > [command=hide]:before { border-right: 0; } +.section.hidden + .hidden > h2 { + padding-left: 5px; +} + .section:last-child { border-bottom: 0; } @@ -414,6 +422,10 @@ html[dir=rtl] #option-menu > [command=hide]:before { display: inline-block; } +#apps { + margin-top: 10px; +} + .section > * { font-size: 12px; } @@ -442,3 +454,22 @@ html[dir=rtl] #option-menu > [command=hide]:before { margin-right: 10px; } } + +#footer { + bottom: 0; + padding-bottom: 5px; + position: absolute; + text-align: end; + width: 100%; +} + +#footer hr { + border: 0; + display: inline; + margin: 0; + padding: 0; +} + +#footer hr:after { + content: "|"; +} diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index 0c04940..c8a01b5 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -71,8 +71,7 @@ var Section = { RECENT: 4, // TIPS is no longer used SYNC: 16, - DEBUG: 32, - APPS: 64 + DEBUG: 32 }; var shownSections = templateData['shown_sections']; @@ -126,6 +125,11 @@ if ('mode' in hashParams) { <div id="main"> + <div id=top-bar> + <input type="button" id="option-button" + i18n-values="title:pagedisplaytooltip"> + </div> + <menu id="option-menu"> <div command="hide" section="THUMB" i18n-content="mostvisited"></div> <div command="hide" section="RECENT" i18n-content="recentlyclosed"></div> @@ -140,25 +144,20 @@ if ('mode' in hashParams) { </div> <div class="sections"> - <div class="section" section="APPS" id="apps-section"> - <h2><img src="ntp/ntp_disclosure_triangle.png" - ><span i18n-content="apps"></span></h2> - <div id="apps-section-content"></div> - </div> + <div class="section disabled" id="apps-section"></div> <div id="most-visited-section" class="section" section="THUMB"> - <h2><img src="ntp/ntp_disclosure_triangle.png" - ><span i18n-content="mostvisited"></span></h2> + <h2 i18n-content="mostvisited"></h2> <div id="most-visited"></div> </div> <div id="recently-closed" class="section" section="RECENT"> - <h2><span i18n-content="recentlyclosed"></span></h2> + <h2 i18n-content="recentlyclosed"></h2> <span class="nav"></span> </div> <div id="debug" class="section disabled" section="DEBUG"> - <h2><span>Debug</span></h2> + <h2>Debug</h2> <div id="apps-launch-control"> Open apps in:<label ><input type="radio" name="launch-container-type" value="" @@ -176,7 +175,6 @@ if ('mode' in hashParams) { <script> updateSimpleSection('recently-closed', Section.RECENT); updateSimpleSection('most-visited-section', Section.THUMB); - updateSimpleSection('apps-section', Section.APPS); updateSimpleSection('debug', Section.DEBUG); </script> @@ -190,6 +188,17 @@ if ('mode' in hashParams) { <img id="attribution-img"> </div> + <div id="footer"> + <a href="chrome://history"><span class="link-color" + i18n-content="history"></span></a> + <hr> + <a href="chrome://downloads"><span class="link-color" + i18n-content="downloads"></span></a> + <hr> + <a i18n-values="href:helpurl"><span class="link-color" + i18n-content="help"></span></a> + </div> + </div> <!-- main --> <div class="window-menu" id="window-tooltip"></div> diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index c0f32bf..b9404a6 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -587,9 +587,6 @@ OptionMenu.prototype = { } }; -// TODO(aa): The 'clear-all-blacklisted' feature needs to move into a menu in -// the most visited section. -/* var optionMenu = new OptionMenu($('option-button'), $('option-menu')); optionMenu.commands = { 'clear-all-blacklisted' : function() { @@ -607,16 +604,10 @@ optionMenu.commands = { saveShownSections(); } }; -*/ $('main').addEventListener('click', function(e) { - var p = e.target; - while (p && p.tagName != 'H2') { - p = p.parentNode; - } - - if (p) { - p = p.parentNode; + if (e.target.tagName == 'H2') { + var p = e.target.parentNode; var section = p.getAttribute('section'); if (section) { if (shownSections & Section[section]) @@ -815,8 +806,7 @@ function callGetSyncMessageIfSyncIsPresent() { } function hideAllMenus() { - // TODO(aa): See comment in definition of optionMenu. - //optionMenu.hide(); + optionMenu.hide(); } window.addEventListener('blur', hideAllMenus); diff --git a/chrome/browser/resources/new_tab_theme.css b/chrome/browser/resources/new_tab_theme.css index 7597812..150d3be 100644 --- a/chrome/browser/resources/new_tab_theme.css +++ b/chrome/browser/resources/new_tab_theme.css @@ -16,8 +16,10 @@ body { overflow: auto; } -/* TODO(aa): Is this still in use? The styling may be incorrect with M7 NTP - rework. */ +#main { + background: url(chrome://theme/IDR_PRODUCT_LOGO?$1) no-repeat 0 8px; +} + #notification.first-run { background-color: $$1; /* COLOR_NTP_SECTION */ border-color: $$2; /* COLOR_NTP_SECTION_BORDER */ @@ -105,22 +107,25 @@ body { color: $$6; /* COLOR_NTP_LINK_UNDERLINE */ } -.section > h2 { - color: $$8; /* COLOR_NTP_SECTION_HEADER_TEXT */ - background-image: url(chrome://theme/IDR_NEWTAB_SECTION_HEADER_BACKGROUND); +#top-bar { + border-bottom: 1px solid $$2; /* COLOR_NTP_SECTION_BORDER */ } -.section > h2:hover { - color: $$9; - background-image: url(chrome://theme/IDR_NEWTAB_SECTION_HEADER_BACKGROUND_H); +.section { + border-top: 1px solid $$2; /* COLOR_NTP_SECTION_BORDER */ + border-bottom: 1px solid $$2; /* COLOR_NTP_SECTION_BORDER */ } -.section:not(.hidden) > h2 { - background-image: url(chrome://theme/IDR_NEWTAB_SECTION_HEADER_BACKGROUND_A); +.section.hidden + :not(.hidden) { + border-top: 1px solid $$2; /* COLOR_NTP_SECTION_BORDER */; } -.section > h2 > span { - background: $2; /* COLOR_NTP_BACKGROUND */ +.section.hidden + .hidden > h2 { + border-left: 1px solid $$2; /* COLOR_NTP_SECTION_BORDER */ +} + +.section > h2 { + color: $8; /* COLOR_NTP_TEXT */ } #apps-section a { @@ -132,3 +137,7 @@ body { color: $$3; /* COLOR_NTP_SECTION_TEXT */ background-color: $$1; /* COLOR_NTP_SECTION */; } + +#footer hr { + color: $$2; /* COLOR_NTP_SECTION_BORDER */ +} diff --git a/chrome/browser/resources/ntp/apps.css b/chrome/browser/resources/ntp/apps.css index 3acaedd..67c7b70 100644 --- a/chrome/browser/resources/ntp/apps.css +++ b/chrome/browser/resources/ntp/apps.css @@ -35,8 +35,7 @@ background: rgba(255, 255, 255, 0) /* transparent white */ no-repeat center 10px; background-size: 96px 96px; - font-family: Helvetica, Arial; - font-size: 14px; + font-weight: bold; overflow: hidden; padding: 111px 10px 10px; /* 10 + 96 + 5 */ text-align: center; diff --git a/chrome/browser/resources/ntp/apps.js b/chrome/browser/resources/ntp/apps.js index 64b490f..41c2e6e 100644 --- a/chrome/browser/resources/ntp/apps.js +++ b/chrome/browser/resources/ntp/apps.js @@ -5,14 +5,26 @@ function getAppsCallback(data) { logEvent('recieved apps'); var appsSection = $('apps-section'); - var appsSectionContent = $('apps-section-content'); - appsSectionContent.textContent = ''; + var debugSection = $('debug'); + appsSection.textContent = ''; data.apps.forEach(function(app) { - appsSectionContent.appendChild(apps.createElement(app)); + appsSection.appendChild(apps.createElement(app)); }); - appsSectionContent.appendChild(apps.createWebStoreElement()); + // TODO(aa): Figure out what to do with the debug mode when we turn apps on + // for everyone. + if (appsSection.hasChildNodes()) { + appsSection.classList.remove('disabled'); + if (data.showDebugLink) { + debugSection.classList.remove('disabled'); + } + + appsSection.appendChild(apps.createWebStoreElement()); + } else { + appsSection.classList.add('disabled'); + debugSection.classList.add('disabled'); + } } var apps = { diff --git a/chrome/browser/resources/ntp/ntp_disclosure_triangle.png b/chrome/browser/resources/ntp/ntp_disclosure_triangle.png Binary files differdeleted file mode 100644 index 6f5c016..0000000 --- a/chrome/browser/resources/ntp/ntp_disclosure_triangle.png +++ /dev/null |