diff options
Diffstat (limited to 'webkit/glue/webkitclient_impl.h')
-rw-r--r-- | webkit/glue/webkitclient_impl.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitclient_impl.h new file mode 100644 index 0000000..bec7a79 --- /dev/null +++ b/webkit/glue/webkitclient_impl.h @@ -0,0 +1,80 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_CLIENT_IMPL_H_ +#define WEBKIT_CLIENT_IMPL_H_ + +#include "base/platform_file.h" +#include "base/timer.h" +#include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" +#if defined(OS_WIN) +#include "webkit/glue/webthemeengine_impl_win.h" +#endif + +class MessageLoop; + +namespace webkit_glue { + +class WebKitClientImpl : public WebKit::WebKitClient { + public: + WebKitClientImpl(); + virtual ~WebKitClientImpl() {} + + // WebKitClient methods (partial implementation): + virtual WebKit::WebThemeEngine* themeEngine(); + + virtual base::PlatformFile databaseOpenFile( + const WebKit::WebString& vfs_file_name, int desired_flags); + virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, + bool sync_dir); + virtual long databaseGetFileAttributes( + const WebKit::WebString& vfs_file_name); + virtual long long databaseGetFileSize(const WebKit::WebString& vfs_file_name); + virtual WebKit::WebString signedPublicKeyAndChallengeString( + unsigned key_size_index, const WebKit::WebString& challenge, + const WebKit::WebURL& url); + virtual size_t memoryUsageMB(); + virtual WebKit::WebURLLoader* createURLLoader(); + virtual WebKit::WebSocketStreamHandle* createSocketStreamHandle(); + virtual WebKit::WebString userAgent(const WebKit::WebURL& url); + virtual void getPluginList(bool refresh, WebKit::WebPluginListBuilder*); + virtual void decrementStatsCounter(const char* name); + virtual void incrementStatsCounter(const char* name); + virtual void traceEventBegin(const char* name, void* id, const char* extra); + virtual void traceEventEnd(const char* name, void* id, const char* extra); + virtual WebKit::WebData loadResource(const char* name); + virtual WebKit::WebString queryLocalizedString( + WebKit::WebLocalizedString::Name name); + virtual WebKit::WebString queryLocalizedString( + WebKit::WebLocalizedString::Name name, int numeric_value); + virtual void suddenTerminationChanged(bool enabled) { } + virtual double currentTime(); + virtual void setSharedTimerFiredFunction(void (*func)()); + virtual void setSharedTimerFireTime(double fireTime); + virtual void stopSharedTimer(); + virtual void callOnMainThread(void (*func)(void*), void* context); + + void SuspendSharedTimer(); + void ResumeSharedTimer(); + + private: + void DoTimeout() { + if (shared_timer_func_ && !shared_timer_suspended_) + shared_timer_func_(); + } + + MessageLoop* main_loop_; + base::OneShotTimer<WebKitClientImpl> shared_timer_; + void (*shared_timer_func_)(); + double shared_timer_fire_time_; + int shared_timer_suspended_; // counter + +#if defined(OS_WIN) + WebThemeEngineImpl theme_engine_; +#endif +}; + +} // namespace webkit_glue + +#endif // WEBKIT_CLIENT_IMPL_H_ |