function makeDeviceDetailsPage(deviceInfo) {
    var deviceDetailsPageId = 'devices/' + deviceInfo.address.toLowerCase();
    var deviceDetailsPage = PageManager.registeredPages[deviceDetailsPageId];
    if (deviceDetailsPage)
      return deviceDetailsPage;

    var pageSection = document.createElement('section');
    pageSection.hidden = true;
    pageSection.id = deviceDetailsPageId;
    $('page-container').appendChild(pageSection);

    deviceDetailsPage = new DeviceDetailsPage(deviceDetailsPageId, deviceInfo);
    deviceDetailsPage.pageDiv.addEventListener(
        'connectionchanged', function(event) {
          devices.updateConnectionStatus(
              event.detail.address, event.detail.status);
        });

    deviceDetailsPage.pageDiv.addEventListener('infochanged', function(event) {
      devices.addOrUpdate(event.detail.info);
    });

    deviceDetailsPage.pageDiv.addEventListener(
        'forgetpressed', function(event) {
          PageManager.showPageByName(devicesPage.name);
          removeDeviceDetailsPage(event.detail.address);
        });

    // Inform the devices page that the user is inspecting this device.
    // This will update the links in the device table.
    devicesPage.setInspecting(deviceInfo, true /* isInspecting */);
    PageManager.register(deviceDetailsPage);

    sidebarObj.addItem({
      pageName: deviceDetailsPageId,
      text: deviceInfo.nameForDisplay,
    });

    deviceDetailsPage.connect();
    return deviceDetailsPage;
  }
/**
   * Creates a DeviceDetailsPage with the given |deviceInfo|, appends it to
   * '#page-container', and adds a sidebar item to show the new page. If a
   * page exists that matches |deviceInfo.address|, nothing is created and the
   * existing page is returned.
   * @param {!bluetooth.mojom.Device} deviceInfo
   * @return {!device_details_page.DeviceDetailsPage}
   */
Creates a DeviceDetailsPage with the given |deviceInfo|, appends it to
'#page-container', and adds a sidebar item to show the new page. If a
page exists that matches |deviceInfo.address|, nothing is created and the
existing page is returned.
Creates a DeviceDetailsPage with the given |deviceInfo| appends it to ' #page - container ' and adds a sidebar item to show the new page . If a page exists that matches |deviceInfo . address| nothing is created and the existing page is returned .
function makeDeviceDetailsPage(deviceInfo) {
    var deviceDetailsPageId = 'devices/' + deviceInfo.address.toLowerCase();
    var deviceDetailsPage = PageManager.registeredPages[deviceDetailsPageId];
    if (deviceDetailsPage)
      return deviceDetailsPage;
    var pageSection = document.createElement('section');
    pageSection.hidden = true;
    pageSection.id = deviceDetailsPageId;
    $('page-container').appendChild(pageSection);
    deviceDetailsPage = new DeviceDetailsPage(deviceDetailsPageId, deviceInfo);
    deviceDetailsPage.pageDiv.addEventListener(
        'connectionchanged', function(event) {
          devices.updateConnectionStatus(
              event.detail.address, event.detail.status);
        });
    deviceDetailsPage.pageDiv.addEventListener('infochanged', function(event) {
      devices.addOrUpdate(event.detail.info);
    });
    deviceDetailsPage.pageDiv.addEventListener(
        'forgetpressed', function(event) {
          PageManager.showPageByName(devicesPage.name);
          removeDeviceDetailsPage(event.detail.address);
        });
    devicesPage.setInspecting(deviceInfo, true );
    PageManager.register(deviceDetailsPage);
    sidebarObj.addItem({
      pageName: deviceDetailsPageId,
      text: deviceInfo.nameForDisplay,
    });
    deviceDetailsPage.connect();
    return deviceDetailsPage;
  }
function makeDeviceDetailsPage ( deviceInfo ) { var deviceDetailsPageId = 'devices/' + deviceInfo . address . toLowerCase ( ) ; var deviceDetailsPage = PageManager . registeredPages [ deviceDetailsPageId ] ; if ( deviceDetailsPage ) return deviceDetailsPage ; var pageSection = document . createElement ( 'section' ) ; pageSection . hidden = true ; pageSection . id = deviceDetailsPageId ; $ ( 'page-container' ) . appendChild ( pageSection ) ; deviceDetailsPage = new DeviceDetailsPage ( deviceDetailsPageId , deviceInfo ) ; deviceDetailsPage . pageDiv . addEventListener ( 'connectionchanged' , function ( event ) { devices . updateConnectionStatus ( event . detail . address , event . detail . status ) ; } ) ; deviceDetailsPage . pageDiv . addEventListener ( 'infochanged' , function ( event ) { devices . addOrUpdate ( event . detail . info ) ; } ) ; deviceDetailsPage . pageDiv . addEventListener ( 'forgetpressed' , function ( event ) { PageManager . showPageByName ( devicesPage . name ) ; removeDeviceDetailsPage ( event . detail . address ) ; } ) ; devicesPage . setInspecting ( deviceInfo , true ) ; PageManager . register ( deviceDetailsPage ) ; sidebarObj . addItem ( { pageName : deviceDetailsPageId , text : deviceInfo . nameForDisplay , } ) ; deviceDetailsPage . connect ( ) ; return deviceDetailsPage ; }
Creates a DeviceDetailsPage with the given |deviceInfo|, appends it to
 '#page-container', and adds a sidebar item to show the new page.
Creates a DeviceDetailsPage with the given |deviceInfo| appends it to ' #page - container ' and adds a sidebar item to show the new page .
// Inform the devices page that the user is inspecting this device. // This will update the links in the device table. /* isInspecting */