diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/resources/new_new_tab.html | 5 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 18 |
2 files changed, 16 insertions, 7 deletions
diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index 79d0c0d..ce5cbeb 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -89,8 +89,13 @@ function isRtl() { return templateData['textdirection'] == 'rtl'; } +// Keep track of the last small state so we can ensure that we are using the +// right mode. This is a workaround for http://crbug.com/25329 +var wasSmallGrid; + function getMostVisitedLayoutRects() { var small = useSmallGrid(); + wasSmallGrid = small; var cols = 4; var rows = 2; diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index 9932cf2..e3da308 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -714,6 +714,7 @@ function onDataLoaded() { // Remove class name in a timeout so that changes done in this JS thread are // not animated. window.setTimeout(function() { + ensureSmallGridCorrect(); removeClass(document.body, 'loading'); }, 1); } @@ -1262,7 +1263,8 @@ $('list-checkbox').addEventListener('change', $('list-checkbox').addEventListener('keydown', getCheckboxHandler(Section.LIST)); -window.addEventListener('load', bind(logEvent, global, 'Tab.NewTabOnload', true)); +window.addEventListener('load', bind(logEvent, global, 'Tab.NewTabOnload', + true)); window.addEventListener('load', onDataLoaded); window.addEventListener('resize', handleWindowResize); @@ -1280,6 +1282,14 @@ document.addEventListener('DOMContentLoaded', // Set up links and text-decoration for promotional message. document.addEventListener('DOMContentLoaded', setUpPromoMessage); +// Work around for http://crbug.com/25329 +function ensureSmallGridCorrect() { + if (wasSmallGrid != useSmallGrid()) { + applyMostVisitedRects(); + } +} +document.addEventListener('DOMContentLoaded', ensureSmallGridCorrect); + /** * The sync code is not yet built by default on all platforms so we have to * make sure we don't send the initial sync message to the backend unless the @@ -1336,12 +1346,6 @@ document.addEventListener('mouseover', function(e) { // DnD var dnd = { - /** - * Windows and Linux only support copy drag and drop. - * @see http://crbug.com/14654/ - * @type {string} - */ - DND_EFFECT: IS_MAC ? 'move' : 'copy', currentOverItem_: null, get currentOverItem() { return this.currentOverItem_; |