summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 15:40:03 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 15:40:03 +0000
commitd260c8d974b4f359f9490d18effeab2858e550c2 (patch)
treee629c7373c98695ce92d4dbf461eab82395bfc77
parent7b1718b5ce2c228649441b5ea3c3fd74b368acc9 (diff)
downloadchromium_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
-rw-r--r--chrome/app/generated_resources.grd10
-rw-r--r--chrome/app/theme/chromium/product_logo_16.pngbin0 -> 992 bytes
-rw-r--r--chrome/app/theme/theme_resources.grd3
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc6
-rw-r--r--chrome/browser/resources/new_tab.html28
5 files changed, 37 insertions, 10 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index f4e2a86..fdde01c 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -3336,9 +3336,13 @@ each locale. -->
<ph name="END_LIST">&lt;/ul&gt;</ph>
<ph name="BEGIN_LINK">&lt;a href="$1"&gt;</ph>Learn more<ph name="END_LINK">&lt;/a&gt;</ph> about incognito browsing.
</message>
- <message name="IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW"
- desc="Title of recently closed windows in the recently closed section of the new tab page">
- Window
+ <message name="IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE"
+ desc="Title of recently closed windows in the recently closed section of the new tab page when the window has a single tab">
+ 1 Tab
+ </message>
+ <message name="IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE"
+ desc="Title of recently closed windows in the recently closed section of the new tab page when the window has more than one tab. The % is replaced by the number of tabs">
+ % Tabs
</message>
<!-- SafeBrowsing -->
diff --git a/chrome/app/theme/chromium/product_logo_16.png b/chrome/app/theme/chromium/product_logo_16.png
new file mode 100644
index 0000000..82be28d
--- /dev/null
+++ b/chrome/app/theme/chromium/product_logo_16.png
Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd
index 2a461c1..4967888 100644
--- a/chrome/app/theme/theme_resources.grd
+++ b/chrome/app/theme/theme_resources.grd
@@ -322,6 +322,7 @@
<include name="IDR_O2_MORE" file="o2_more.png" type="BINDATA" />
<include name="IDR_O2_SEARCH" file="o2_search.png" type="BINDATA" />
<include name="IDR_O2_STAR" file="o2_star.png" type="BINDATA" />
+ <include name="IDR_CLOSED_WINDOW" file="closed_window.png" type="BINDATA" />
<if expr="pp_ifdef('_google_chrome')">
<include name="IDR_ABOUT_BACKGROUND" file="google_chrome/about_background.png" type="BINDATA" />
@@ -330,6 +331,7 @@
<include name="IDR_DISTRIBUTOR_LOGO" file="google_chrome/distributor_logo.png" type="BINDATA" />
<include name="IDR_DISTRIBUTOR_LOGO_LIGHT" file="google_chrome/distributor_logo_light.png" type="BINDATA" />
<include name="IDR_PRODUCT_LOGO" file="google_chrome/product_logo.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_16" file="google_chrome/product_logo_16.png" type="BINDATA" />
<include name="IDR_WIZARD_ICON" file="google_chrome/wizard_icon.png" type="BINDATA" />
<include name="IDR_WIZARD_ICON_RTL" file="google_chrome/wizard_icon_rtl.png" type="BINDATA" />
</if>
@@ -339,6 +341,7 @@
<include name="IDR_ABOUT_BACKGROUND_RTL" file="chromium/about_background_rtl.png" type="BINDATA" />
<include name="IDR_ABOUT_BACKGROUND_COLOR" file="chromium/about_background_color.png" type="BINDATA" />
<include name="IDR_PRODUCT_LOGO" file="chromium/product_logo.png" type="BINDATA" />
+ <include name="IDR_PRODUCT_LOGO_16" file="chromium/product_logo_16.png" type="BINDATA" />
<include name="IDR_WIZARD_ICON" file="chromium/wizard_icon.png" type="BINDATA" />
<include name="IDR_WIZARD_ICON_RTL" file="chromium/wizard_icon_rtl.png" type="BINDATA" />
</if>
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 90bf3dc..9965b43 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -262,8 +262,10 @@ void NewTabHTMLSource::StartDataRequest(const std::string& path,
localized_strings.SetString(L"mostvisitedintro",
l10n_util::GetStringF(IDS_NEW_TAB_MOST_VISITED_INTRO,
l10n_util::GetString(IDS_WELCOME_PAGE_URL)));
- localized_strings.SetString(L"closedwindow",
- l10n_util::GetString(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW));
+ localized_strings.SetString(L"closedwindowsingle",
+ l10n_util::GetString(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE));
+ localized_strings.SetString(L"closedwindowmultiple",
+ l10n_util::GetString(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE));
SetFontAndTextDirection(&localized_strings);
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>