cefclient: Request all browser windows to close in response to the application’s Quit/Exit menu item (issue #853).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1172 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-04-03 19:29:47 +00:00
parent 5533ceb06b
commit 758470dfca
4 changed files with 69 additions and 14 deletions

View File

@@ -6,6 +6,7 @@
#define CEF_TESTS_CEFCLIENT_CLIENT_HANDLER_H_
#pragma once
#include <list>
#include <map>
#include <set>
#include <string>
@@ -236,6 +237,9 @@ class ClientHandler : public CefClient,
CefRefPtr<CefBrowser> GetBrowser() { return m_Browser; }
int GetBrowserId() { return m_BrowserId; }
// Request that all existing browser windows close.
void CloseAllBrowsers(bool force_close);
// Returns true if the main browser window is currently closing. Used in
// combination with DoClose() and the OS close notification to properly handle
// 'onbeforeunload' JavaScript events during window close.
@@ -295,6 +299,10 @@ class ClientHandler : public CefClient,
// The child browser window
CefRefPtr<CefBrowser> m_Browser;
// List of any popup browser windows. Only accessed on the CEF UI thread.
typedef std::list<CefRefPtr<CefBrowser> > BrowserList;
BrowserList m_PopupBrowsers;
// The main frame window handle
CefWindowHandle m_MainHwnd;