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

Side by Side Diff: chrome/browser/resources/ntp4/new_tab.js

Issue 8110003: Show avatar menu from NTP4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/browser_window.h » ('j') | chrome/browser/ui/browser_window.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview New tab page 6 * @fileoverview New tab page
7 * This is the main code for the new tab page used by touch-enabled Chrome 7 * This is the main code for the new tab page used by touch-enabled Chrome
8 * browsers. For now this is still a prototype. 8 * browsers. For now this is still a prototype.
9 */ 9 */
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 shownPage = templateData['shown_page_type']; 143 shownPage = templateData['shown_page_type'];
144 shownPageIndex = templateData['shown_page_index']; 144 shownPageIndex = templateData['shown_page_index'];
145 145
146 // Request data on the apps so we can fill them in. 146 // Request data on the apps so we can fill them in.
147 // Note that this is kicked off asynchronously. 'getAppsCallback' will be 147 // Note that this is kicked off asynchronously. 'getAppsCallback' will be
148 // invoked at some point after this function returns. 148 // invoked at some point after this function returns.
149 chrome.send('getApps'); 149 chrome.send('getApps');
150 150
151 chrome.send('initializeLogin'); 151 chrome.send('initializeLogin');
152 $('login-container').addEventListener('click', function() { 152 $('login-container').addEventListener('click', function() {
153 chrome.send('loginContainerClicked'); 153 var rect = $('login-container').getBoundingClientRect();
154 chrome.send('loginContainerClicked', [rect.right, rect.bottom]);
arv (Not doing code reviews) 2011/10/03 17:06:09 Don't you want to send the entire rect here? RTL a
sail 2011/10/03 18:46:03 Done. I've also filed http://crbug.com/98884 about
154 }); 155 });
155 156
156 // Prevent touch events from triggering any sort of native scrolling 157 // Prevent touch events from triggering any sort of native scrolling
157 document.addEventListener('touchmove', function(e) { 158 document.addEventListener('touchmove', function(e) {
158 e.preventDefault(); 159 e.preventDefault();
159 }, true); 160 }, true);
160 161
161 tilePages = pageList.getElementsByClassName('tile-page'); 162 tilePages = pageList.getElementsByClassName('tile-page');
162 appsPages = pageList.getElementsByClassName('apps-page'); 163 appsPages = pageList.getElementsByClassName('apps-page');
163 164
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 var getAppsCallback = ntp4.getAppsCallback; 880 var getAppsCallback = ntp4.getAppsCallback;
880 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; 881 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback;
881 var themeChanged = ntp4.themeChanged; 882 var themeChanged = ntp4.themeChanged;
882 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; 883 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs;
883 var setMostVisitedPages = ntp4.setMostVisitedPages; 884 var setMostVisitedPages = ntp4.setMostVisitedPages;
884 var updateLogin = ntp4.updateLogin; 885 var updateLogin = ntp4.updateLogin;
885 886
886 document.addEventListener('DOMContentLoaded', ntp4.initialize); 887 document.addEventListener('DOMContentLoaded', ntp4.initialize);
887 window.addEventListener('online', ntp4.updateOfflineEnabledApps); 888 window.addEventListener('online', ntp4.updateOfflineEnabledApps);
888 window.addEventListener('offline', ntp4.updateOfflineEnabledApps); 889 window.addEventListener('offline', ntp4.updateOfflineEnabledApps);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_window.h » ('j') | chrome/browser/ui/browser_window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698