Add Browser class to controll when the application should quit.

This commit is contained in:
Cheng Zhao 2013-05-02 23:43:23 +08:00
parent 8cf1050730
commit d151d494bd
12 changed files with 138 additions and 7 deletions

View file

@ -188,6 +188,15 @@ content::JavaScriptDialogManager* NativeWindow::GetJavaScriptDialogManager() {
return dialog_manager_.get();
}
void NativeWindow::BeforeUnloadFired(content::WebContents* tab,
bool proceed,
bool* proceed_to_fire_unload) {
*proceed_to_fire_unload = proceed;
if (!proceed)
WindowList::WindowCloseCancelled(this);
}
void NativeWindow::CloseContents(content::WebContents* source) {
// When the web contents is gone, close the window immediately, but the
// memory will not be freed until you call delete.