onActivityUpdated() {
    if (this.tab) {
      this.activity.setContentTitle(this.tab.title);
      this.activity.setIncognito(this.tab.incognito);
      const url = new URL(this.tab.url);
      if (url.protocol == 'file:') {
        this.activity.setType(mr.mirror.Activity.Type.MIRROR_FILE);
        this.activity.setOrigin(null);
      } else {
        this.activity.setType(
            this.isRemoting ? mr.mirror.Activity.Type.MEDIA_REMOTING :
                              mr.mirror.Activity.Type.MIRROR_TAB);
        if (url.protocol == 'https:') {
          // OK to drop the protocol for secure origins.
          this.activity.setOrigin(url.origin.substr(8));
        } else {
          this.activity.setOrigin(url.origin);
        }
      }
    }
    this.route.description = this.activity.getRouteDescription();
    this.onActivityUpdate_ && this.onActivityUpdate_(this.route, this.activity);
    this.sendActivityToSink();
  }
/**
   * Called when the activity object for the mirror session needs to be updated.
   * This happens when e.g. the tab being mirrored navigates, changes title, or
   * switches in or out of media remoting.
   */
Called when the activity object for the mirror session needs to be updated.
Called when the activity object for the mirror session needs to be updated .
onActivityUpdated() {
    if (this.tab) {
      this.activity.setContentTitle(this.tab.title);
      this.activity.setIncognito(this.tab.incognito);
      const url = new URL(this.tab.url);
      if (url.protocol == 'file:') {
        this.activity.setType(mr.mirror.Activity.Type.MIRROR_FILE);
        this.activity.setOrigin(null);
      } else {
        this.activity.setType(
            this.isRemoting ? mr.mirror.Activity.Type.MEDIA_REMOTING :
                              mr.mirror.Activity.Type.MIRROR_TAB);
        if (url.protocol == 'https:') {
          this.activity.setOrigin(url.origin.substr(8));
        } else {
          this.activity.setOrigin(url.origin);
        }
      }
    }
    this.route.description = this.activity.getRouteDescription();
    this.onActivityUpdate_ && this.onActivityUpdate_(this.route, this.activity);
    this.sendActivityToSink();
  }
onActivityUpdated ( ) { if ( this . tab ) { this . activity . setContentTitle ( this . tab . title ) ; this . activity . setIncognito ( this . tab . incognito ) ; const url = new URL ( this . tab . url ) ; if ( url . protocol == 'file:' ) { this . activity . setType ( mr . mirror . Activity . Type . MIRROR_FILE ) ; this . activity . setOrigin ( null ) ; } else { this . activity . setType ( this . isRemoting ? mr . mirror . Activity . Type . MEDIA_REMOTING : mr . mirror . Activity . Type . MIRROR_TAB ) ; if ( url . protocol == 'https:' ) { this . activity . setOrigin ( url . origin . substr ( 8 ) ) ; } else { this . activity . setOrigin ( url . origin ) ; } } } this . route . description = this . activity . getRouteDescription ( ) ; this . onActivityUpdate_ && this . onActivityUpdate_ ( this . route , this . activity ) ; this . sendActivityToSink ( ) ; }
Called when the activity object for the mirror session needs to be updated.
Called when the activity object for the mirror session needs to be updated .
// OK to drop the protocol for secure origins.