function sendCommand(cmd) {
  if (window.certificateErrorPageController) {
    switch (cmd) {
      case SecurityInterstitialCommandId.CMD_DONT_PROCEED:
        certificateErrorPageController.dontProceed();
        break;
      case SecurityInterstitialCommandId.CMD_PROCEED:
        certificateErrorPageController.proceed();
        break;
      case SecurityInterstitialCommandId.CMD_SHOW_MORE_SECTION:
        certificateErrorPageController.showMoreSection();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_HELP_CENTER:
        certificateErrorPageController.openHelpCenter();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_DIAGNOSTIC:
        certificateErrorPageController.openDiagnostic();
        break;
      case SecurityInterstitialCommandId.CMD_RELOAD:
        certificateErrorPageController.reload();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_DATE_SETTINGS:
        certificateErrorPageController.openDateSettings();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_LOGIN:
        certificateErrorPageController.openLogin();
        break;
      case SecurityInterstitialCommandId.CMD_DO_REPORT:
        certificateErrorPageController.doReport();
        break;
      case SecurityInterstitialCommandId.CMD_DONT_REPORT:
        certificateErrorPageController.dontReport();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_REPORTING_PRIVACY:
        certificateErrorPageController.openReportingPrivacy();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_WHITEPAPER:
        certificateErrorPageController.openWhitepaper();
        break;
      case SecurityInterstitialCommandId.CMD_REPORT_PHISHING_ERROR:
        certificateErrorPageController.reportPhishingError();
        break;
    }
    return;
  }
// <if expr="not is_ios">
  window.domAutomationController.send(cmd);
// </if>
// <if expr="is_ios">
  // TODO(crbug.com/565877): Revisit message passing for WKWebView.
  var iframe = document.createElement('IFRAME');
  iframe.setAttribute('src', 'js-command:' + cmd);
  document.documentElement.appendChild(iframe);
  iframe.parentNode.removeChild(iframe);
// </if>
}
/**
 * A convenience method for sending commands to the parent page.
 * @param {string} cmd  The command to send.
 */
A convenience method for sending commands to the parent page.
@param {string} cmd  The command to send.
A convenience method for sending commands to the parent page . @param { string } cmd The command to send .
function sendCommand(cmd) {
  if (window.certificateErrorPageController) {
    switch (cmd) {
      case SecurityInterstitialCommandId.CMD_DONT_PROCEED:
        certificateErrorPageController.dontProceed();
        break;
      case SecurityInterstitialCommandId.CMD_PROCEED:
        certificateErrorPageController.proceed();
        break;
      case SecurityInterstitialCommandId.CMD_SHOW_MORE_SECTION:
        certificateErrorPageController.showMoreSection();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_HELP_CENTER:
        certificateErrorPageController.openHelpCenter();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_DIAGNOSTIC:
        certificateErrorPageController.openDiagnostic();
        break;
      case SecurityInterstitialCommandId.CMD_RELOAD:
        certificateErrorPageController.reload();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_DATE_SETTINGS:
        certificateErrorPageController.openDateSettings();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_LOGIN:
        certificateErrorPageController.openLogin();
        break;
      case SecurityInterstitialCommandId.CMD_DO_REPORT:
        certificateErrorPageController.doReport();
        break;
      case SecurityInterstitialCommandId.CMD_DONT_REPORT:
        certificateErrorPageController.dontReport();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_REPORTING_PRIVACY:
        certificateErrorPageController.openReportingPrivacy();
        break;
      case SecurityInterstitialCommandId.CMD_OPEN_WHITEPAPER:
        certificateErrorPageController.openWhitepaper();
        break;
      case SecurityInterstitialCommandId.CMD_REPORT_PHISHING_ERROR:
        certificateErrorPageController.reportPhishingError();
        break;
    }
    return;
  }
  window.domAutomationController.send(cmd);
  var iframe = document.createElement('IFRAME');
  iframe.setAttribute('src', 'js-command:' + cmd);
  document.documentElement.appendChild(iframe);
  iframe.parentNode.removeChild(iframe);
}
function sendCommand ( cmd ) { if ( window . certificateErrorPageController ) { switch ( cmd ) { case SecurityInterstitialCommandId . CMD_DONT_PROCEED : certificateErrorPageController . dontProceed ( ) ; break ; case SecurityInterstitialCommandId . CMD_PROCEED : certificateErrorPageController . proceed ( ) ; break ; case SecurityInterstitialCommandId . CMD_SHOW_MORE_SECTION : certificateErrorPageController . showMoreSection ( ) ; break ; case SecurityInterstitialCommandId . CMD_OPEN_HELP_CENTER : certificateErrorPageController . openHelpCenter ( ) ; break ; case SecurityInterstitialCommandId . CMD_OPEN_DIAGNOSTIC : certificateErrorPageController . openDiagnostic ( ) ; break ; case SecurityInterstitialCommandId . CMD_RELOAD : certificateErrorPageController . reload ( ) ; break ; case SecurityInterstitialCommandId . CMD_OPEN_DATE_SETTINGS : certificateErrorPageController . openDateSettings ( ) ; break ; case SecurityInterstitialCommandId . CMD_OPEN_LOGIN : certificateErrorPageController . openLogin ( ) ; break ; case SecurityInterstitialCommandId . CMD_DO_REPORT : certificateErrorPageController . doReport ( ) ; break ; case SecurityInterstitialCommandId . CMD_DONT_REPORT : certificateErrorPageController . dontReport ( ) ; break ; case SecurityInterstitialCommandId . CMD_OPEN_REPORTING_PRIVACY : certificateErrorPageController . openReportingPrivacy ( ) ; break ; case SecurityInterstitialCommandId . CMD_OPEN_WHITEPAPER : certificateErrorPageController . openWhitepaper ( ) ; break ; case SecurityInterstitialCommandId . CMD_REPORT_PHISHING_ERROR : certificateErrorPageController . reportPhishingError ( ) ; break ; } return ; } window . domAutomationController . send ( cmd ) ; var iframe = document . createElement ( 'IFRAME' ) ; iframe . setAttribute ( 'src' , 'js-command:' + cmd ) ; document . documentElement . appendChild ( iframe ) ; iframe . parentNode . removeChild ( iframe ) ; }
A convenience method for sending commands to the parent page.
A convenience method for sending commands to the parent page .
// <if expr="not is_ios"> // </if> // <if expr="is_ios"> // TODO(crbug.com/565877): Revisit message passing for WKWebView. // </if>