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

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: Address review comments 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
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.left, rect.top, rect.width,
155 rect.height]);
154 }); 156 });
155 157
156 // Prevent touch events from triggering any sort of native scrolling 158 // Prevent touch events from triggering any sort of native scrolling
157 document.addEventListener('touchmove', function(e) { 159 document.addEventListener('touchmove', function(e) {
158 e.preventDefault(); 160 e.preventDefault();
159 }, true); 161 }, true);
160 162
161 tilePages = pageList.getElementsByClassName('tile-page'); 163 tilePages = pageList.getElementsByClassName('tile-page');
162 appsPages = pageList.getElementsByClassName('apps-page'); 164 appsPages = pageList.getElementsByClassName('apps-page');
163 165
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 var getAppsCallback = ntp4.getAppsCallback; 881 var getAppsCallback = ntp4.getAppsCallback;
880 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; 882 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback;
881 var themeChanged = ntp4.themeChanged; 883 var themeChanged = ntp4.themeChanged;
882 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; 884 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs;
883 var setMostVisitedPages = ntp4.setMostVisitedPages; 885 var setMostVisitedPages = ntp4.setMostVisitedPages;
884 var updateLogin = ntp4.updateLogin; 886 var updateLogin = ntp4.updateLogin;
885 887
886 document.addEventListener('DOMContentLoaded', ntp4.initialize); 888 document.addEventListener('DOMContentLoaded', ntp4.initialize);
887 window.addEventListener('online', ntp4.updateOfflineEnabledApps); 889 window.addEventListener('online', ntp4.updateOfflineEnabledApps);
888 window.addEventListener('offline', ntp4.updateOfflineEnabledApps); 890 window.addEventListener('offline', ntp4.updateOfflineEnabledApps);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_window.h » ('j') | chrome/browser/ui/webui/ntp/ntp_login_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698