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

Unified Diff: chrome/browser/resources/ntp4/bookmarks_page.js

Issue 7810007: [ntp4] More UI refinements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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/ntp4/bookmarks_page.js
===================================================================
--- chrome/browser/resources/ntp4/bookmarks_page.js (revision 98872)
+++ chrome/browser/resources/ntp4/bookmarks_page.js (working copy)
@@ -59,11 +59,10 @@
var faviconDiv = this.querySelector('.favicon');
var faviconUrl;
if (this.data.url) {
- faviconUrl = 'chrome://favicon/size/32/' + this.data.url;
+ faviconUrl = 'chrome://favicon/size/16/' + this.data.url;
chrome.send('getFaviconDominantColor',
[faviconUrl, id, 'ntp4.setBookmarksFaviconDominantColor']);
} else {
- // TODO(csilv): We need a large (32px) icon for this URL.
faviconUrl = 'chrome://theme/IDR_BOOKMARK_BAR_FOLDER';
// TODO(csilv): Should we vary this color by platform?
this.stripeColor = '#919191';
@@ -89,8 +88,11 @@
* animate.
*/
setBounds: function(size, x, y) {
- this.style.width = this.style.height = size + 'px';
+ this.style.width = size + 'px';
+ this.style.height = heightForWidth(size) + 'px';
+
this.style.left = x + 'px';
+ this.style.right = x + 'px';
this.style.top = y + 'px';
},
@@ -173,6 +175,16 @@
TilePage.initGridValues(bookmarksPageGridValues);
/**
+ * Calculates the height for a bookmarks tile for a given width. The size
+ * is based on a desired size of 96x72 ratio.
+ * @return {number} The height.
+ */
+ function heightForWidth(width) {
+ // The 2s are for borders, the 31 is for the title.
+ return (width - 2) * 72 / 96 + 2 + 31;
+ }
+
+ /**
* Creates a new BookmarksPage object.
* @constructor
* @extends {TilePage}
@@ -275,6 +287,9 @@
return false;
},
+ /** @inheritDoc */
+ heightForWidth: heightForWidth,
+
/**
* Invoked before a batch import begins. We will ignore added/changed
* notifications while the operation is in progress.
« no previous file with comments | « chrome/browser/resources/ntp4/bookmarks_page.css ('k') | chrome/browser/resources/ntp4/most_visited_page.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698