@Override
  public void onBannerFailed(MoPubErrorCode errorCode) {
    if (isInvalidated()) return;

    if (mMoPubView != null) {
      if (errorCode == null) {
        errorCode = UNSPECIFIED;
      }
      cancelTimeout();
      mMoPubView.loadFailUrl(errorCode);
    }
  }
  /*
   * CustomEventBanner.Listener implementation
   */
  @Override
  public void onBannerLoaded(View bannerView) {
    if (isInvalidated()) return;

    if (mMoPubView != null) {
      cancelTimeout();
      mMoPubView.nativeAdLoaded();
      mMoPubView.setAdContentView(bannerView);
      if (!(bannerView instanceof HtmlBannerWebView)) {
        mMoPubView.trackNativeImpression();
      }
    }
  }