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_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/file_util.h" |
8 #include "base/path_service.h" | 9 #include "base/path_service.h" |
9 #include "base/stats_counters.h" | 10 #include "base/stats_counters.h" |
10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
11 #include "media/base/media.h" | 12 #include "media/base/media.h" |
12 #include "webkit/api/public/WebData.h" | 13 #include "webkit/api/public/WebData.h" |
13 #include "webkit/api/public/WebKit.h" | 14 #include "webkit/api/public/WebKit.h" |
14 #include "webkit/api/public/WebString.h" | 15 #include "webkit/api/public/WebString.h" |
15 #include "webkit/api/public/WebURL.h" | 16 #include "webkit/api/public/WebURL.h" |
16 #include "webkit/glue/simple_webmimeregistry_impl.h" | 17 #include "webkit/glue/simple_webmimeregistry_impl.h" |
17 #include "webkit/glue/webclipboard_impl.h" | 18 #include "webkit/glue/webclipboard_impl.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 virtual WebKit::WebString cookies( | 90 virtual WebKit::WebString cookies( |
90 const WebKit::WebURL& url, | 91 const WebKit::WebURL& url, |
91 const WebKit::WebURL& first_party_for_cookies) { | 92 const WebKit::WebURL& first_party_for_cookies) { |
92 return UTF8ToUTF16(SimpleResourceLoaderBridge::GetCookies( | 93 return UTF8ToUTF16(SimpleResourceLoaderBridge::GetCookies( |
93 url, first_party_for_cookies)); | 94 url, first_party_for_cookies)); |
94 } | 95 } |
95 | 96 |
96 virtual void prefetchHostName(const WebKit::WebString&) { | 97 virtual void prefetchHostName(const WebKit::WebString&) { |
97 } | 98 } |
98 | 99 |
| 100 virtual bool getFileSize(const WebKit::WebString& path, long long& result) { |
| 101 return file_util::GetFileSize( |
| 102 FilePath(webkit_glue::WebStringToFilePathString(path)), &result); |
| 103 } |
| 104 |
99 virtual WebKit::WebData loadResource(const char* name) { | 105 virtual WebKit::WebData loadResource(const char* name) { |
100 if (!strcmp(name, "deleteButton")) { | 106 if (!strcmp(name, "deleteButton")) { |
101 // Create a red 30x30 square. | 107 // Create a red 30x30 square. |
102 const char red_square[] = | 108 const char red_square[] = |
103 "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52" | 109 "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52" |
104 "\x00\x00\x00\x1e\x00\x00\x00\x1e\x04\x03\x00\x00\x00\xc9\x1e\xb3" | 110 "\x00\x00\x00\x1e\x00\x00\x00\x1e\x04\x03\x00\x00\x00\xc9\x1e\xb3" |
105 "\x91\x00\x00\x00\x30\x50\x4c\x54\x45\x00\x00\x00\x80\x00\x00\x00" | 111 "\x91\x00\x00\x00\x30\x50\x4c\x54\x45\x00\x00\x00\x80\x00\x00\x00" |
106 "\x80\x00\x80\x80\x00\x00\x00\x80\x80\x00\x80\x00\x80\x80\x80\x80" | 112 "\x80\x00\x80\x80\x00\x00\x00\x80\x80\x00\x80\x00\x80\x80\x80\x80" |
107 "\x80\xc0\xc0\xc0\xff\x00\x00\x00\xff\x00\xff\xff\x00\x00\x00\xff" | 113 "\x80\xc0\xc0\xc0\xff\x00\x00\x00\xff\x00\xff\xff\x00\x00\x00\xff" |
108 "\xff\x00\xff\x00\xff\xff\xff\xff\xff\x7b\x1f\xb1\xc4\x00\x00\x00" | 114 "\xff\x00\xff\x00\xff\xff\xff\xff\xff\x7b\x1f\xb1\xc4\x00\x00\x00" |
(...skipping 10 matching lines...) Expand all Loading... |
119 virtual WebKit::WebString defaultLocale() { | 125 virtual WebKit::WebString defaultLocale() { |
120 return ASCIIToUTF16("en-US"); | 126 return ASCIIToUTF16("en-US"); |
121 } | 127 } |
122 | 128 |
123 private: | 129 private: |
124 webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; | 130 webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; |
125 scoped_ptr<WebKit::WebClipboard> clipboard_; | 131 scoped_ptr<WebKit::WebClipboard> clipboard_; |
126 }; | 132 }; |
127 | 133 |
128 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ | 134 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ |
OLD | NEW |