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

Side by Side Diff: chrome/browser/resources/history/other_devices.js

Issue 1143963002: Split NTPLoginHandler across chrome://apps and chrome://history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp fixes Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/app_launcher_login_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 The section of the history page that shows tabs from sessions 6 * @fileoverview The section of the history page that shows tabs from sessions
7 on other devices. 7 on other devices.
8 */ 8 */
9 9
10 /////////////////////////////////////////////////////////////////////////////// 10 ///////////////////////////////////////////////////////////////////////////////
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 */ 528 */
529 function setForeignSessions(sessionList, isTabSyncEnabled) { 529 function setForeignSessions(sessionList, isTabSyncEnabled) {
530 // The other devices is shown iff tab sync is enabled. 530 // The other devices is shown iff tab sync is enabled.
531 if (isTabSyncEnabled) 531 if (isTabSyncEnabled)
532 devicesView.setSessionList(sessionList); 532 devicesView.setSessionList(sessionList);
533 else 533 else
534 devicesView.clearDOM(); 534 devicesView.clearDOM();
535 } 535 }
536 536
537 /** 537 /**
538 * Called when this element is initialized, and from the new tab page when 538 * Called when initialized or the user's signed in state changes,
539 * the user's signed in state changes,
540 * @param {string} header The first line of text (unused here).
541 * @param {string} subHeader The second line of text (unused here).
542 * @param {string} iconURL The url for the login status icon. If this is null
543 then the login status icon is hidden (unused here).
544 * @param {boolean} isUserSignedIn Is the user currently signed in? 539 * @param {boolean} isUserSignedIn Is the user currently signed in?
545 */ 540 */
546 function updateLogin(header, subHeader, iconURL, isUserSignedIn) { 541 function updateSignInState(isUserSignedIn) {
547 if (devicesView) 542 if (devicesView)
548 devicesView.updateSignInState(isUserSignedIn); 543 devicesView.updateSignInState(isUserSignedIn);
549 } 544 }
550 545
551 /////////////////////////////////////////////////////////////////////////////// 546 ///////////////////////////////////////////////////////////////////////////////
552 // Document Functions: 547 // Document Functions:
553 /** 548 /**
554 * Window onload handler, sets up the other devices view. 549 * Window onload handler, sets up the other devices view.
555 */ 550 */
556 function load() { 551 function load() {
557 if (!loadTimeData.getBoolean('isInstantExtendedApiEnabled')) 552 if (!loadTimeData.getBoolean('isInstantExtendedApiEnabled'))
558 return; 553 return;
559 554
560 // We must use this namespace to reuse the handler code for foreign session
561 // and login. TODO(estade): change the call site in ntp_login_handler.cc so
562 // this hack isn't necessary.
563 cr.define('ntp', function() {
564 return {
565 updateLogin: updateLogin
566 };
567 });
568
569 devicesView = new DevicesView(); 555 devicesView = new DevicesView();
570 556
571 // Create the context menu that appears when the user right clicks 557 // Create the context menu that appears when the user right clicks
572 // on a device name or hit click on the button besides the device name 558 // on a device name or hit click on the button besides the device name
573 document.body.appendChild(DeviceContextMenuController.getInstance().menu); 559 document.body.appendChild(DeviceContextMenuController.getInstance().menu);
574 560
575 var doSearch = function(e) { 561 var doSearch = function(e) {
576 devicesView.setSearchText($('search-field').value); 562 devicesView.setSearchText($('search-field').value);
577 }; 563 };
578 $('search-field').addEventListener('search', doSearch); 564 $('search-field').addEventListener('search', doSearch);
579 $('search-button').addEventListener('click', doSearch); 565 $('search-button').addEventListener('click', doSearch);
566
567 chrome.send('otherDevicesInitialized');
580 } 568 }
581 569
582 // Add handlers to HTML elements. 570 // Add handlers to HTML elements.
583 document.addEventListener('DOMContentLoaded', load); 571 document.addEventListener('DOMContentLoaded', load);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/app_launcher_login_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698