Exemplo n.º 1
0
void BrowserList::AttemptExitInternal()
{
    //NotificationService::current()->Notify(
    //    content::NOTIFICATION_APP_EXITING,
    //    NotificationService::AllSources(),
    //    NotificationService::NoDetails());

    // On most platforms, closing all windows causes the application to exit.
    CloseAllBrowsers();
}
Exemplo n.º 2
0
bool PhantomJSHandler::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
                                                CefProcessId source_process,
                                                CefRefPtr<CefProcessMessage> message)
{
  if (m_messageRouter->OnProcessMessageReceived(browser, source_process, message)) {
    return true;
  }
  if (message->GetName() == "exit") {
    CloseAllBrowsers(true);
    return true;
  }
  return false;
}
Exemplo n.º 3
0
bool WindowClient::OnProcessMessageReceived(
    CefRefPtr<CefBrowser> browser,
    CefProcessId source_process,
    CefRefPtr<CefProcessMessage> message
) {
    if (message->GetName() == "quit") {
        s_result = message->GetArgumentList()->GetInt(0);
        printf("Quitting with value %d\n", s_result);
        printf("Log:\n%S", message->GetArgumentList()->GetString(1).ToWString().c_str());

        CloseAllBrowsers();
    } else {
        printf("Unknown message %s\n", message->GetName().ToString().c_str());
    }
    return false;
}
Exemplo n.º 4
0
// static
void BrowserList::EndKeepAlive()
{
    DCHECK_GT(keep_alive_count_, 0);
    keep_alive_count_--;
    // Allow the app to shutdown again.
    if(!WillKeepAlive())
    {
        //g_browser_process->ReleaseModule();
        // If there are no browsers open and we aren't already shutting down,
        // initiate a shutdown. Also skips shutdown if this is a unit test
        // (MessageLoop::current() == null).
        if(browsers_.empty() && !browser_shutdown::IsTryingToQuit() &&
            MessageLoop::current())
        {
            CloseAllBrowsers();
			WindowInterface::GetInstance()->at_exit();
			ui::ResourceBundle::CleanupSharedInstance();
			exit(0);
        }
    }
}