OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/compositor/test/compositor_test_support.h" | 5 #include "ui/gfx/compositor/test/compositor_test_support.h" |
6 | 6 |
7 #if defined(USE_WEBKIT_COMPOSITOR) | 7 #if defined(USE_WEBKIT_COMPOSITOR) |
| 8 #include "base/compiler_specific.h" |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
9 #include "webkit/glue/webkitplatformsupport_impl.h" | 10 #include "webkit/glue/webkitplatformsupport_impl.h" |
10 #endif | 11 #endif |
11 | 12 |
12 namespace ui { | 13 namespace ui { |
13 | 14 |
14 #if defined(USE_WEBKIT_COMPOSITOR) | 15 #if defined(USE_WEBKIT_COMPOSITOR) |
15 static webkit_glue::WebKitPlatformSupportImpl* g_webkit_support; | 16 class CompositorTestPlatformSupport: |
| 17 public NON_EXPORTED_BASE(webkit_glue::WebKitPlatformSupportImpl) { |
| 18 public: |
| 19 virtual string16 GetLocalizedString(int message_id) OVERRIDE { |
| 20 return string16(); |
| 21 } |
| 22 |
| 23 virtual base::StringPiece GetDataResource(int resource_id) OVERRIDE { |
| 24 return base::StringPiece(); |
| 25 } |
| 26 |
| 27 virtual void GetPlugins( |
| 28 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) OVERRIDE { |
| 29 } |
| 30 |
| 31 virtual webkit_glue::ResourceLoaderBridge* CreateResourceLoader( |
| 32 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) |
| 33 OVERRIDE { |
| 34 NOTREACHED(); |
| 35 return NULL; |
| 36 } |
| 37 |
| 38 virtual webkit_glue::WebSocketStreamHandleBridge* CreateWebSocketBridge( |
| 39 WebKit::WebSocketStreamHandle* handle, |
| 40 webkit_glue::WebSocketStreamHandleDelegate* delegate) OVERRIDE { |
| 41 NOTREACHED(); |
| 42 return NULL; |
| 43 } |
| 44 }; |
| 45 |
| 46 static CompositorTestPlatformSupport* g_webkit_support; |
16 #endif | 47 #endif |
17 | 48 |
18 void CompositorTestSupport::Initialize() { | 49 void CompositorTestSupport::Initialize() { |
19 #if defined(USE_WEBKIT_COMPOSITOR) | 50 #if defined(USE_WEBKIT_COMPOSITOR) |
20 DCHECK(!g_webkit_support); | 51 DCHECK(!g_webkit_support); |
21 g_webkit_support = new webkit_glue::WebKitPlatformSupportImpl; | 52 g_webkit_support = new CompositorTestPlatformSupport; |
22 WebKit::initialize(g_webkit_support); | 53 WebKit::initialize(g_webkit_support); |
23 #endif | 54 #endif |
24 } | 55 } |
25 | 56 |
26 void CompositorTestSupport::Terminate() { | 57 void CompositorTestSupport::Terminate() { |
27 #if defined(USE_WEBKIT_COMPOSITOR) | 58 #if defined(USE_WEBKIT_COMPOSITOR) |
28 DCHECK(g_webkit_support); | 59 DCHECK(g_webkit_support); |
29 WebKit::shutdown(); | 60 WebKit::shutdown(); |
30 delete g_webkit_support; | 61 delete g_webkit_support; |
31 g_webkit_support = NULL; | 62 g_webkit_support = NULL; |
32 #endif | 63 #endif |
33 } | 64 } |
34 | 65 |
35 } // namespace ui | 66 } // namespace ui |
OLD | NEW |