Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: webkit/tools/test_shell/test_shell_webkit_init.h

Issue 40132: Refactor v8 extensions to make registration avoid having to use ChromiumBridg... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_
6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_
7 7
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "webkit/glue/simple_webmimeregistry_impl.h" 9 #include "webkit/glue/simple_webmimeregistry_impl.h"
10 #include "webkit/glue/webkit_glue.h" 10 #include "webkit/glue/webkit_glue.h"
11 #include "webkit/glue/webkitclient_impl.h" 11 #include "webkit/glue/webkitclient_impl.h"
12 #include "webkit/extensions/v8/gears_extension.h"
13 #include "webkit/extensions/v8/interval_extension.h"
12 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" 14 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
13 15
14 #include "WebKit.h" 16 #include "WebKit.h"
15 #include "WebString.h" 17 #include "WebString.h"
16 #include "WebURL.h" 18 #include "WebURL.h"
17 19
18 class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { 20 class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
19 public: 21 public:
20 TestShellWebKitInit(bool layout_test_mode) { 22 TestShellWebKitInit(bool layout_test_mode) {
21 WebKit::initialize(this); 23 WebKit::initialize(this);
22 WebKit::setLayoutTestMode(layout_test_mode); 24 WebKit::setLayoutTestMode(layout_test_mode);
23 WebKit::registerURLSchemeAsLocal( 25 WebKit::registerURLSchemeAsLocal(
24 ASCIIToUTF16(webkit_glue::GetUIResourceProtocol())); 26 ASCIIToUTF16(webkit_glue::GetUIResourceProtocol()));
27 WebKit::registerExtension(extensions_v8::GearsExtension::Get());
28 WebKit::registerExtension(extensions_v8::IntervalExtension::Get());
25 } 29 }
26 30
27 ~TestShellWebKitInit() { 31 ~TestShellWebKitInit() {
28 WebKit::shutdown(); 32 WebKit::shutdown();
29 } 33 }
30 34
31 virtual WebKit::WebMimeRegistry* mimeRegistry() { 35 virtual WebKit::WebMimeRegistry* mimeRegistry() {
32 return &mime_registry_; 36 return &mime_registry_;
33 } 37 }
34 38
(...skipping 13 matching lines...) Expand all
48 52
49 virtual WebKit::WebString defaultLocale() { 53 virtual WebKit::WebString defaultLocale() {
50 return ASCIIToUTF16("en-US"); 54 return ASCIIToUTF16("en-US");
51 } 55 }
52 56
53 private: 57 private:
54 webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; 58 webkit_glue::SimpleWebMimeRegistryImpl mime_registry_;
55 }; 59 };
56 60
57 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ 61 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698