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) | |
8 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
10 #include "webkit/glue/webkitplatformsupport_impl.h" | 9 #include "webkit/glue/webkitplatformsupport_impl.h" |
11 #endif | |
12 | 10 |
13 namespace ui { | 11 namespace ui { |
14 | 12 |
15 #if defined(USE_WEBKIT_COMPOSITOR) | |
16 class CompositorTestPlatformSupport: | 13 class CompositorTestPlatformSupport: |
17 public NON_EXPORTED_BASE(webkit_glue::WebKitPlatformSupportImpl) { | 14 public NON_EXPORTED_BASE(webkit_glue::WebKitPlatformSupportImpl) { |
18 public: | 15 public: |
19 virtual string16 GetLocalizedString(int message_id) OVERRIDE { | 16 virtual string16 GetLocalizedString(int message_id) OVERRIDE { |
20 return string16(); | 17 return string16(); |
21 } | 18 } |
22 | 19 |
23 virtual base::StringPiece GetDataResource(int resource_id) OVERRIDE { | 20 virtual base::StringPiece GetDataResource(int resource_id) OVERRIDE { |
24 return base::StringPiece(); | 21 return base::StringPiece(); |
25 } | 22 } |
(...skipping 11 matching lines...) Expand all Loading... |
37 | 34 |
38 virtual webkit_glue::WebSocketStreamHandleBridge* CreateWebSocketBridge( | 35 virtual webkit_glue::WebSocketStreamHandleBridge* CreateWebSocketBridge( |
39 WebKit::WebSocketStreamHandle* handle, | 36 WebKit::WebSocketStreamHandle* handle, |
40 webkit_glue::WebSocketStreamHandleDelegate* delegate) OVERRIDE { | 37 webkit_glue::WebSocketStreamHandleDelegate* delegate) OVERRIDE { |
41 NOTREACHED(); | 38 NOTREACHED(); |
42 return NULL; | 39 return NULL; |
43 } | 40 } |
44 }; | 41 }; |
45 | 42 |
46 static CompositorTestPlatformSupport* g_webkit_support; | 43 static CompositorTestPlatformSupport* g_webkit_support; |
47 #endif | |
48 | 44 |
49 void CompositorTestSupport::Initialize() { | 45 void CompositorTestSupport::Initialize() { |
50 #if defined(USE_WEBKIT_COMPOSITOR) | |
51 DCHECK(!g_webkit_support); | 46 DCHECK(!g_webkit_support); |
52 g_webkit_support = new CompositorTestPlatformSupport; | 47 g_webkit_support = new CompositorTestPlatformSupport; |
53 WebKit::initialize(g_webkit_support); | 48 WebKit::initialize(g_webkit_support); |
54 #endif | |
55 } | 49 } |
56 | 50 |
57 void CompositorTestSupport::Terminate() { | 51 void CompositorTestSupport::Terminate() { |
58 #if defined(USE_WEBKIT_COMPOSITOR) | |
59 DCHECK(g_webkit_support); | 52 DCHECK(g_webkit_support); |
60 WebKit::shutdown(); | 53 WebKit::shutdown(); |
61 delete g_webkit_support; | 54 delete g_webkit_support; |
62 g_webkit_support = NULL; | 55 g_webkit_support = NULL; |
63 #endif | |
64 } | 56 } |
65 | 57 |
66 } // namespace ui | 58 } // namespace ui |
OLD | NEW |