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

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

Issue 8637001: [NTP4] Auto-deletion of empty apps panes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding back erroneously removed ; 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 if (shouldShowLoginBubble) { 318 if (shouldShowLoginBubble) {
319 window.setTimeout(loginBubble.show.bind(loginBubble), 0); 319 window.setTimeout(loginBubble.show.bind(loginBubble), 0);
320 chrome.send('loginMessageSeen'); 320 chrome.send('loginMessageSeen');
321 shouldShowLoginBubble = false; 321 shouldShowLoginBubble = false;
322 } 322 }
323 } 323 }
324 324
325 /** 325 /**
326 * Wrappers to forward the callback to corresponding PageListView member. 326 * Wrappers to forward the callback to corresponding PageListView member.
327 */ 327 */
328 function appAdded(appData, opt_highlight) { 328 function appAdded() {
329 newTabView.appAdded(appData, opt_highlight); 329 return newTabView.appAdded.apply(newTabView, arguments);
330 } 330 }
331 331
332 function appRemoved(appData, isUninstall) { 332 function appsPrefChangeCallback() {
333 newTabView.appRemoved(appData, isUninstall); 333 return newTabView.appsPrefChangedCallback.apply(newTabView, arguments);
334 } 334 }
335 335
336 function appsPrefChangeCallback(data) { 336 function appRemoved() {
337 newTabView.appsPrefChangedCallback(data); 337 return newTabView.appRemoved.apply(newTabView, arguments);
338 }
339
340 function appsReordered() {
341 return newTabView.appsReordered.apply(newTabView, arguments);
338 } 342 }
339 343
340 function enterRearrangeMode() { 344 function enterRearrangeMode() {
341 newTabView.enterRearrangeMode(); 345 return newTabView.enterRearrangeMode.apply(newTabView, arguments);
342 } 346 }
343 347
344 function getAppsCallback(data) { 348 function getAppsCallback() {
345 newTabView.getAppsCallback(data); 349 return newTabView.getAppsCallback.apply(newTabView, arguments);
346 } 350 }
347 351
348 function getAppsPageIndex(page) { 352 function getAppsPageIndex() {
349 return newTabView.getAppsPageIndex(page); 353 return newTabView.getAppsPageIndex.apply(newTabView, arguments);
350 } 354 }
351 355
352 function getCardSlider() { 356 function getCardSlider() {
353 return newTabView.cardSlider; 357 return newTabView.cardSlider;
354 } 358 }
355 359
356 function leaveRearrangeMode(e) { 360 function leaveRearrangeMode() {
357 newTabView.leaveRearrangeMode(e); 361 return newTabView.leaveRearrangeMode.apply(newTabView, arguments);
358 } 362 }
359 363
360 function saveAppPageName(appPage, name) { 364 function removeAppsPageIfEmpty() {
361 newTabView.saveAppPageName(appPage, name); 365 return newTabView.removeAppsPageIfEmpty.apply(newTabView, arguments);
366 }
367
368 function saveAppsPageName() {
369 return newTabView.saveAppsPageName.apply(newTabView, arguments);
362 } 370 }
363 371
364 function setAppToBeHighlighted(appId) { 372 function setAppToBeHighlighted(appId) {
365 newTabView.highlightAppId = appId; 373 newTabView.highlightAppId = appId;
366 } 374 }
367 375
368 // Return an object with all the exports 376 // Return an object with all the exports
369 return { 377 return {
370 appAdded: appAdded, 378 appAdded: appAdded,
371 appRemoved: appRemoved, 379 appRemoved: appRemoved,
380 appsReordered: appsReordered,
372 appsPrefChangeCallback: appsPrefChangeCallback, 381 appsPrefChangeCallback: appsPrefChangeCallback,
373 enterRearrangeMode: enterRearrangeMode, 382 enterRearrangeMode: enterRearrangeMode,
374 getAppsCallback: getAppsCallback, 383 getAppsCallback: getAppsCallback,
375 getAppsPageIndex: getAppsPageIndex, 384 getAppsPageIndex: getAppsPageIndex,
376 getCardSlider: getCardSlider, 385 getCardSlider: getCardSlider,
377 onLoad: onLoad, 386 onLoad: onLoad,
378 leaveRearrangeMode: leaveRearrangeMode, 387 leaveRearrangeMode: leaveRearrangeMode,
379 saveAppPageName: saveAppPageName, 388 removeAppsPageIfEmpty: removeAppsPageIfEmpty,
389 saveAppsPageName: saveAppsPageName,
380 setAppToBeHighlighted: setAppToBeHighlighted, 390 setAppToBeHighlighted: setAppToBeHighlighted,
381 setMostVisitedPages: setMostVisitedPages, 391 setMostVisitedPages: setMostVisitedPages,
382 setRecentlyClosedTabs: setRecentlyClosedTabs, 392 setRecentlyClosedTabs: setRecentlyClosedTabs,
383 setStripeColor: setStripeColor, 393 setStripeColor: setStripeColor,
384 showNotification: showNotification, 394 showNotification: showNotification,
385 themeChanged: themeChanged, 395 themeChanged: themeChanged,
386 updateLogin: updateLogin 396 updateLogin: updateLogin
387 }; 397 };
388 }); 398 });
389 399
390 // publish ntp globals 400 // publish ntp globals
391 // TODO(estade): update the content handlers to use ntp namespace instead of 401 // TODO(estade): update the content handlers to use ntp namespace instead of
392 // making these global. 402 // making these global.
393 var getAppsCallback = ntp4.getAppsCallback; 403 var getAppsCallback = ntp4.getAppsCallback;
394 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; 404 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback;
395 var themeChanged = ntp4.themeChanged; 405 var themeChanged = ntp4.themeChanged;
396 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; 406 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs;
397 var setMostVisitedPages = ntp4.setMostVisitedPages; 407 var setMostVisitedPages = ntp4.setMostVisitedPages;
398 var updateLogin = ntp4.updateLogin; 408 var updateLogin = ntp4.updateLogin;
399 409
400 document.addEventListener('DOMContentLoaded', ntp4.onLoad); 410 document.addEventListener('DOMContentLoaded', ntp4.onLoad);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698