| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_CLIENT_IMPL_H_ | 5 #ifndef WEBKIT_CLIENT_IMPL_H_ |
| 6 #define WEBKIT_CLIENT_IMPL_H_ | 6 #define WEBKIT_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/timer.h" | 8 #include "base/timer.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 11 #include "webkit/glue/webthemeengine_impl_win.h" | 11 #include "webkit/glue/webthemeengine_impl_win.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 class MessageLoop; | 14 class MessageLoop; |
| 15 | 15 |
| 16 namespace webkit_glue { | 16 namespace webkit_glue { |
| 17 | 17 |
| 18 class WebKitClientImpl : public WebKit::WebKitClient { | 18 class WebKitClientImpl : public WebKit::WebKitClient { |
| 19 public: | 19 public: |
| 20 WebKitClientImpl(); | 20 WebKitClientImpl(); |
| 21 | 21 |
| 22 // WebKitClient methods (partial implementation): | 22 // WebKitClient methods (partial implementation): |
| 23 virtual WebKit::WebThemeEngine* themeEngine(); | 23 virtual WebKit::WebThemeEngine* themeEngine(); |
| 24 virtual void getPluginList(bool refresh, WebKit::WebPluginListBuilder*); |
| 24 virtual void decrementStatsCounter(const char* name); | 25 virtual void decrementStatsCounter(const char* name); |
| 25 virtual void incrementStatsCounter(const char* name); | 26 virtual void incrementStatsCounter(const char* name); |
| 26 virtual void traceEventBegin(const char* name, void* id, const char* extra); | 27 virtual void traceEventBegin(const char* name, void* id, const char* extra); |
| 27 virtual void traceEventEnd(const char* name, void* id, const char* extra); | 28 virtual void traceEventEnd(const char* name, void* id, const char* extra); |
| 28 virtual WebKit::WebData loadResource(const char* name); | 29 virtual WebKit::WebData loadResource(const char* name); |
| 29 virtual double currentTime(); | 30 virtual double currentTime(); |
| 30 virtual void setSharedTimerFiredFunction(void (*func)()); | 31 virtual void setSharedTimerFiredFunction(void (*func)()); |
| 31 virtual void setSharedTimerFireTime(double fireTime); | 32 virtual void setSharedTimerFireTime(double fireTime); |
| 32 virtual void stopSharedTimer(); | 33 virtual void stopSharedTimer(); |
| 33 virtual void callOnMainThread(void (*func)()); | 34 virtual void callOnMainThread(void (*func)()); |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 void DoTimeout() { | 37 void DoTimeout() { |
| 37 if (shared_timer_func_) | 38 if (shared_timer_func_) |
| 38 shared_timer_func_(); | 39 shared_timer_func_(); |
| 39 } | 40 } |
| 40 | 41 |
| 41 MessageLoop* main_loop_; | 42 MessageLoop* main_loop_; |
| 42 base::OneShotTimer<WebKitClientImpl> shared_timer_; | 43 base::OneShotTimer<WebKitClientImpl> shared_timer_; |
| 43 void (*shared_timer_func_)(); | 44 void (*shared_timer_func_)(); |
| 44 | 45 |
| 45 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
| 46 WebThemeEngineImpl theme_engine_; | 47 WebThemeEngineImpl theme_engine_; |
| 47 #endif | 48 #endif |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 } // namespace webkit_glue | 51 } // namespace webkit_glue |
| 51 | 52 |
| 52 #endif // WEBKIT_CLIENT_IMPL_H_ | 53 #endif // WEBKIT_CLIENT_IMPL_H_ |
| OLD | NEW |