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 #ifndef WEBKIT_GLUE_WEBKIT_GLUE_H_ | 5 #ifndef WEBKIT_GLUE_WEBKIT_GLUE_H_ |
6 #define WEBKIT_GLUE_WEBKIT_GLUE_H_ | 6 #define WEBKIT_GLUE_WEBKIT_GLUE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <windows.h> | 11 #include <windows.h> |
12 #endif | 12 #endif |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/file_path.h" | 17 #include "base/file_path.h" |
18 #include "base/platform_file.h" | 18 #include "base/platform_file.h" |
19 #include "base/string16.h" | 19 #include "base/string16.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileError.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileError.h" |
22 #include "ui/base/clipboard/clipboard.h" | |
23 | 22 |
24 class GURL; | 23 class GURL; |
25 class SkBitmap; | 24 class SkBitmap; |
26 | 25 |
27 namespace base { | 26 namespace base { |
28 class StringPiece; | 27 class StringPiece; |
29 } | 28 } |
30 | 29 |
31 namespace skia { | 30 namespace skia { |
32 class PlatformCanvas; | 31 class PlatformCanvas; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // Glue to get resources from the embedder. | 159 // Glue to get resources from the embedder. |
161 | 160 |
162 // Gets a localized string given a message id. Returns an empty string if the | 161 // Gets a localized string given a message id. Returns an empty string if the |
163 // message id is not found. | 162 // message id is not found. |
164 string16 GetLocalizedString(int message_id); | 163 string16 GetLocalizedString(int message_id); |
165 | 164 |
166 // Returns the raw data for a resource. This resource must have been | 165 // Returns the raw data for a resource. This resource must have been |
167 // specified as BINDATA in the relevant .rc file. | 166 // specified as BINDATA in the relevant .rc file. |
168 base::StringPiece GetDataResource(int resource_id); | 167 base::StringPiece GetDataResource(int resource_id); |
169 | 168 |
170 // Glue to access the clipboard. | |
171 | |
172 // Get a clipboard that can be used to construct a ScopedClipboardWriterGlue. | |
173 ui::Clipboard* ClipboardGetClipboard(); | |
174 | |
175 // Get a sequence number which uniquely identifies clipboard state. | |
176 uint64 ClipboardGetSequenceNumber(ui::Clipboard::Buffer buffer); | |
177 | |
178 // Tests whether the clipboard contains a certain format | |
179 bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format, | |
180 ui::Clipboard::Buffer buffer); | |
181 | |
182 // Reads the available types from the clipboard, if available. | |
183 void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer, | |
184 std::vector<string16>* types, | |
185 bool* contains_filenames); | |
186 | |
187 // Reads UNICODE text from the clipboard, if available. | |
188 void ClipboardReadText(ui::Clipboard::Buffer buffer, string16* result); | |
189 | |
190 // Reads ASCII text from the clipboard, if available. | |
191 void ClipboardReadAsciiText(ui::Clipboard::Buffer buffer, std::string* result); | |
192 | |
193 // Reads HTML from the clipboard, if available. | |
194 void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup, | |
195 GURL* url, uint32* fragment_start, | |
196 uint32* fragment_end); | |
197 | |
198 void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data); | |
199 | |
200 // Embedders implement this function to return the list of plugins to Webkit. | 169 // Embedders implement this function to return the list of plugins to Webkit. |
201 void GetPlugins(bool refresh, | 170 void GetPlugins(bool refresh, |
202 std::vector<webkit::WebPluginInfo>* plugins); | 171 std::vector<webkit::WebPluginInfo>* plugins); |
203 | 172 |
204 // Returns true if the protocol implemented to serve |url| supports features | 173 // Returns true if the protocol implemented to serve |url| supports features |
205 // required by the media engine. | 174 // required by the media engine. |
206 bool IsProtocolSupportedForMedia(const GURL& url); | 175 bool IsProtocolSupportedForMedia(const GURL& url); |
207 | 176 |
208 // Returns the locale that this instance of webkit is running as. This is of | |
209 // the form language-country (e.g., en-US or pt-BR). | |
210 std::string GetWebKitLocale(); | |
211 | |
212 // Returns true if the embedder is running in single process mode. | |
213 bool IsSingleProcess(); | |
214 | |
215 // ---- END FUNCTIONS IMPLEMENTED BY EMBEDDER --------------------------------- | 177 // ---- END FUNCTIONS IMPLEMENTED BY EMBEDDER --------------------------------- |
216 | 178 |
217 | 179 |
218 } // namespace webkit_glue | 180 } // namespace webkit_glue |
219 | 181 |
220 #endif // WEBKIT_GLUE_WEBKIT_GLUE_H_ | 182 #endif // WEBKIT_GLUE_WEBKIT_GLUE_H_ |
OLD | NEW |