diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-23 15:40:03 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-23 15:40:03 +0000 |
commit | d260c8d974b4f359f9490d18effeab2858e550c2 (patch) | |
tree | e629c7373c98695ce92d4dbf461eab82395bfc77 /chrome/browser/resources | |
parent | 7b1718b5ce2c228649441b5ea3c3fd74b368acc9 (diff) | |
download | chromium_src-d260c8d974b4f359f9490d18effeab2858e550c2.zip chromium_src-d260c8d974b4f359f9490d18effeab2858e550c2.tar.gz chromium_src-d260c8d974b4f359f9490d18effeab2858e550c2.tar.bz2 |
Changes closed windows on the new tab page to show the Chromium/Chrome
icon and the text to show the number of closed windows.
BUG=9022
TEST=With more than one window open close a window. Go to the new tab
page and make sure you see an entry for the closed window. The entry
should have the chrome/chromium logo and instead of 'Window' it
should say the number of tabs in the window.
Review URL: http://codereview.chromium.org/92022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14309 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/new_tab.html | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/chrome/browser/resources/new_tab.html b/chrome/browser/resources/new_tab.html index 55fd3bf..8eb0edc 100644 --- a/chrome/browser/resources/new_tab.html +++ b/chrome/browser/resources/new_tab.html @@ -280,6 +280,7 @@ a.thumbnail { line-height:16px; display:block; margin:3px 0px 3px 0px; + padding-left:22px; } .recent-window-container img { margin:0 3px -2px 3px; @@ -400,7 +401,8 @@ html[dir='rtl'] #searches input { <body onload="logEvent('body onload fired');" jsvalues=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> <div id="l10n" style="display:none;"> - <span id="closedwindow" jscontent="closedwindow">Window</span> + <span id="closedwindowsingle" jscontent="closedwindowsingle">1 Tab</span> + <span id="closedwindowmultiple" jscontent="closedwindowmultiple">% Tabs</span> </div> <script> // We apply the size class here so that we don't trigger layout animations onload. @@ -786,7 +788,7 @@ function renderRecentlyClosedTabs(entries) { var linkSpanContainer = DOM('div', { className: 'recent-window-container'}); var linkSpan = DOM('span'); - linkSpan.appendChild(document.createTextNode(" (")); + linkSpan.appendChild(document.createTextNode(" ")); for (var windowIndex = 0; windowIndex < entry.tabs.length; windowIndex++) { var tab = entry.tabs[windowIndex]; var tabImg = DOM('img', { @@ -796,12 +798,11 @@ function renderRecentlyClosedTabs(entries) { tabImg.onmousedown = function() { return false; } linkSpan.appendChild(tabImg); } - linkSpan.appendChild(document.createTextNode(")")); link = DOM('span', { className: 'recently-closed-window-link' } ); windowSpan = DOM('span', {className: 'recently-close-window-text'}); - windowSpan.appendChild( - document.createTextNode(localStrings.getString('closedwindow'))); + windowSpan.appendChild(document.createTextNode( + recentlyClosedWindowText(entry.tabs.length))); link.appendChild(windowSpan); link.appendChild(linkSpan); linkSpanContainer.appendChild(link); @@ -828,6 +829,19 @@ function renderRecentlyClosedTabs(entries) { } /** + * Returns the text used for a recently closed window. + * + * @param numTabs number of tabs in the window + * + * @return the text to use + */ +function recentlyClosedWindowText(numTabs) { + if (numTabs == 1) + return localStrings.getString('closedwindowsingle'); + return localStrings.getString('closedwindowmultiple').replace('%', numTabs); +} + +/** * Creates an item to go in the recent bookmarks or recently closed lists. * * @param {String} tagName Tagname for the DOM element to create. @@ -1033,6 +1047,10 @@ setTimeout(function(){document.getElementById('main').className = 'visible'}, .edit-mode div.edit-cross:active { background: url('../../app/theme/ntp_x_icon_active.png'); } +.recent-window-container { + background: url('../../app/theme/closed_window.png'); + background-repeat: no-repeat; +} </style> </html> |