chrome/updater/test/service/win/uac.py
def AnswerUpcomingUACPrompt(allow=True, timeout=30):
  """Answer upcoming UAC prompt that does not require username/password.

  Args:
    allow: Answer allow or not to the prompt.
    timeout: Wait timeout value in seconds.

  Returns:
    True if UAC prompt clicked as requested.
  """
  logging.info('Waiting at most %s seconds for UAC prompt...', timeout)
  uac_hwnd = ui.WaitForWindow(_UAC_DIALOG_TITLE, None, timeout)[0]

  if not uac_hwnd:
    logging.warning('UAC prompt not found in %f seconds.', timeout)
    return False
  else:
    logging.info('UAC prompt appeared.')

  # We assume the UAC prompt does not require credentials.
  # Press shortcut key Alt+Y or ESC to allow or deny UAC request.
  logging.info('%s UAC prompt.', 'Accepting' if allow else 'Denying')
  key_to_send = '%y' if allow else '{ESC}'
  return ui.SendKeyToWindow(uac_hwnd, key_to_send)
Answer upcoming UAC prompt that does not require username/password.

  Args:
    allow: Answer allow or not to the prompt.
    timeout: Wait timeout value in seconds.

  Returns:
    True if UAC prompt clicked as requested.
  
Answer upcoming UAC prompt that does not require username/password.
Answer upcoming UAC prompt that does not require username / password .
def AnswerUpcomingUACPrompt(allow=True, timeout=30):
  logging.info('Waiting at most %s seconds for UAC prompt...', timeout)
  uac_hwnd = ui.WaitForWindow(_UAC_DIALOG_TITLE, None, timeout)[0]
  if not uac_hwnd:
    logging.warning('UAC prompt not found in %f seconds.', timeout)
    return False
  else:
    logging.info('UAC prompt appeared.')
  logging.info('%s UAC prompt.', 'Accepting' if allow else 'Denying')
  key_to_send = '%y' if allow else '{ESC}'
  return ui.SendKeyToWindow(uac_hwnd, key_to_send)
def AnswerUpcomingUACPrompt ( allow = True , timeout = 30 ) : logging . info ( 'Waiting at most %s seconds for UAC prompt...' , timeout ) uac_hwnd = ui . WaitForWindow ( _UAC_DIALOG_TITLE , None , timeout ) [ 0 ] if not uac_hwnd : logging . warning ( 'UAC prompt not found in %f seconds.' , timeout ) return False else : logging . info ( 'UAC prompt appeared.' ) logging . info ( '%s UAC prompt.' , 'Accepting' if allow else 'Denying' ) key_to_send = '%y' if allow else '{ESC}' return ui . SendKeyToWindow ( uac_hwnd , key_to_send )
Answer upcoming UAC prompt that does not require username/password.
Answer upcoming UAC prompt that does not require username / password .
"""Answer upcoming UAC prompt that does not require username/password.

  Args:
    allow: Answer allow or not to the prompt.
    timeout: Wait timeout value in seconds.

  Returns:
    True if UAC prompt clicked as requested.
  """ # We assume the UAC prompt does not require credentials. # Press shortcut key Alt+Y or ESC to allow or deny UAC request.
True if UAC prompt clicked as requested.
True if UAC prompt clicked as requested .
allow
Answer allow or not to the prompt.
Answer allow or not to the prompt .
timeout
Wait timeout value in seconds.
Wait timeout value in seconds .