Allow the cast tray to function as expected when the installed extension is missing API methods.

BUG=489445

Review URL: https://codereview.chromium.org/1145833003

Cr-Commit-Position: refs/heads/master@{#330663}
void TrayCast::UpdatePrimaryView() {
  if (HasCastExtension() == false) {
    if (default_)
      default_->SetVisible(false);
    if (tray_) {
      base::MessageLoopForUI::current()->PostTask(
          FROM_HERE, base::Bind(&tray::CastTrayView::SetVisible,
                                tray_->AsWeakPtr(), false));
    }
  } else {
    if (default_) {
      if (is_casting_)
        default_->ActivateCastView();
      else
        default_->ActivateSelectView();
    }

    if (tray_)
      tray_->SetVisible(is_casting_);
  }
}

void TrayCast::UpdatePrimaryView() {
  if (HasCastExtension() == false) {
    if (default_)
      default_->SetVisible(false);
    if (tray_) {
      base::MessageLoopForUI::current()->PostTask(
          FROM_HERE, base::Bind(&tray::CastTrayView::SetVisible,
                                tray_->AsWeakPtr(), false));
    }
  } else {
    if (default_) {
      if (is_casting_)
        default_->ActivateCastView();
      else
        default_->ActivateSelectView();
    }

    if (tray_)
      tray_->SetVisible(is_casting_);
  }
}
