// Copyright (c) 2009 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/timer.h" #include "webkit/api/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(); // WebKitClient methods (partial implementation): virtual WebKit::WebThemeEngine* themeEngine(); virtual WebKit::WebURLLoader* createURLLoader(); 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 double currentTime(); virtual void setSharedTimerFiredFunction(void (*func)()); virtual void setSharedTimerFireTime(double fireTime); virtual void stopSharedTimer(); virtual void callOnMainThread(void (*func)()); virtual void suddenTerminationChanged(bool enabled) { } private: void DoTimeout() { if (shared_timer_func_) shared_timer_func_(); } MessageLoop* main_loop_; base::OneShotTimer shared_timer_; void (*shared_timer_func_)(); #if defined(OS_WIN) WebThemeEngineImpl theme_engine_; #endif }; } // namespace webkit_glue #endif // WEBKIT_CLIENT_IMPL_H_