示例#1
0
void ChromeClient::print(LocalFrame* frame) {
  // Defer loads in case the client method runs a new event loop that would
  // otherwise cause the load to continue while we're in the middle of
  // executing JavaScript.
  ScopedPageLoadDeferrer deferrer;

  printDelegate(frame);
}
示例#2
0
bool ChromeClient::print(LocalFrame* frame) {
  if (frame->document()->isSandboxed(SandboxModals)) {
    UseCounter::count(frame, UseCounter::DialogInSandboxedContext);
    frame->console().addMessage(ConsoleMessage::create(
        SecurityMessageSource, ErrorMessageLevel,
        "Ignored call to 'print()'. The document is sandboxed, and the "
        "'allow-modals' keyword is not set."));
    return false;
  }

  // Defer loads in case the client method runs a new event loop that would
  // otherwise cause the load to continue while we're in the middle of
  // executing JavaScript.
  ScopedPageLoadDeferrer deferrer;

  printDelegate(frame);
  return true;
}