Add support for navigator.onLine and online/offline window events (issue #234).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@234 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-05-18 15:49:52 +00:00
parent abfc77abd1
commit 9a69e96950
2 changed files with 32 additions and 1 deletions

View File

@ -7,7 +7,9 @@
#define _CEF_PROCESS_UI_THREAD
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "cef_thread.h"
#include "net/base/network_change_notifier.h"
class BrowserWebKitInit;
namespace base {
@ -23,7 +25,10 @@ class StatsTable;
// Applications must initialize the COM library before they can call
// COM library functions other than CoGetMalloc and memory allocation
// functions, so this class initializes COM for those users.
class CefProcessUIThread : public CefThread {
class CefProcessUIThread
: public net::NetworkChangeNotifier::OnlineStateObserver,
public CefThread
{
public:
explicit CefProcessUIThread();
CefProcessUIThread(MessageLoop* message_loop);
@ -36,11 +41,16 @@ class CefProcessUIThread : public CefThread {
void PlatformInit();
void PlatformCleanUp();
// From net::NetworkChangeNotifier::OnlineStateObserver
void OnOnlineStateChanged(bool online);
base::StatsTable* statstable_;
// WebKit implementation class.
BrowserWebKitInit* webkit_init_;
scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
DISALLOW_COPY_AND_ASSIGN(CefProcessUIThread);
};