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

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

Issue 8680033: Show GAIA profile info in NTP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove shadow Created 9 years 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 if (node) 352 if (node)
353 node.stripeColor = color; 353 node.stripeColor = color;
354 } 354 }
355 355
356 /** 356 /**
357 * Updates the text displayed in the login container. If there is no text then 357 * Updates the text displayed in the login container. If there is no text then
358 * the login container is hidden. 358 * the login container is hidden.
359 * @param {string} loginHeader The first line of text. 359 * @param {string} loginHeader The first line of text.
360 * @param {string} loginSubHeader The second line of text. 360 * @param {string} loginSubHeader The second line of text.
361 */ 361 */
362 function updateLogin(loginHeader, loginSubHeader) { 362 function updateLogin(loginHeader, loginSubHeader, icon_url) {
Evan Stade 2011/12/02 00:03:26 camel case and documentation
sail 2011/12/02 01:19:57 Done.
363 if (loginHeader || loginSubHeader) { 363 if (loginHeader || loginSubHeader) {
364 $('login-container').hidden = false; 364 $('login-container').hidden = false;
365 $('login-status-header').innerHTML = loginHeader; 365 $('login-status-header').innerHTML = loginHeader;
366 $('login-status-sub-header').innerHTML = loginSubHeader; 366 $('login-status-sub-header').innerHTML = loginSubHeader;
367 $('card-slider-frame').classList.add('showing-login-area'); 367 $('card-slider-frame').classList.add('showing-login-area');
368
369 if (icon_url) {
370 console.log("setting icon");
Evan Stade 2011/12/02 00:03:26 debug output?
sail 2011/12/02 01:19:57 Done.
371 $('login-status-icon').hidden = false;
372 $('login-status-icon').style.backgroundImage = url(icon_url);
373 } else {
374 console.log("not setting icon");
375 $('login-status-icon').hidden = true;
376 }
368 } else { 377 } else {
369 $('login-container').hidden = true; 378 $('login-container').hidden = true;
370 $('card-slider-frame').classList.remove('showing-login-area'); 379 $('card-slider-frame').classList.remove('showing-login-area');
371 } 380 }
372 if (shouldShowLoginBubble) { 381 if (shouldShowLoginBubble) {
373 window.setTimeout(loginBubble.show.bind(loginBubble), 0); 382 window.setTimeout(loginBubble.show.bind(loginBubble), 0);
374 chrome.send('loginMessageSeen'); 383 chrome.send('loginMessageSeen');
375 shouldShowLoginBubble = false; 384 shouldShowLoginBubble = false;
385 } else if (loginBubble) {
386 loginBubble.reposition();
376 } 387 }
377 } 388 }
378 389
379 /** 390 /**
380 * Wrappers to forward the callback to corresponding PageListView member. 391 * Wrappers to forward the callback to corresponding PageListView member.
381 */ 392 */
382 function appAdded(appData, opt_highlight) { 393 function appAdded(appData, opt_highlight) {
383 newTabView.appAdded(appData, opt_highlight); 394 newTabView.appAdded(appData, opt_highlight);
384 } 395 }
385 396
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 // TODO(estade): update the content handlers to use ntp namespace instead of 464 // TODO(estade): update the content handlers to use ntp namespace instead of
454 // making these global. 465 // making these global.
455 var getAppsCallback = ntp4.getAppsCallback; 466 var getAppsCallback = ntp4.getAppsCallback;
456 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; 467 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback;
457 var themeChanged = ntp4.themeChanged; 468 var themeChanged = ntp4.themeChanged;
458 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; 469 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs;
459 var setMostVisitedPages = ntp4.setMostVisitedPages; 470 var setMostVisitedPages = ntp4.setMostVisitedPages;
460 var updateLogin = ntp4.updateLogin; 471 var updateLogin = ntp4.updateLogin;
461 472
462 document.addEventListener('DOMContentLoaded', ntp4.onLoad); 473 document.addEventListener('DOMContentLoaded', ntp4.onLoad);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698