| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/platform_file.h" | 17 #include "base/platform_file.h" |
| 18 #include "base/string16.h" | 18 #include "base/string16.h.h" |
| 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebCanvas.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebCanvas.h" |
| 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" | 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" |
| 21 #include "webkit/glue/webkit_glue_export.h" | 21 #include "webkit/glue/webkit_glue_export.h" |
| 22 | 22 |
| 23 class SkBitmap; | 23 class SkBitmap; |
| 24 class SkCanvas; | 24 class SkCanvas; |
| 25 | 25 |
| 26 namespace net { | 26 namespace net { |
| 27 class URLRequest; | 27 class URLRequest; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace WebKit { | 30 namespace WebKit { |
| 31 struct WebFileInfo; | 31 struct WebFileInfo; |
| 32 class WebFrame; | 32 class WebFrame; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace webkit_glue { | 35 namespace webkit_glue { |
| 36 | 36 |
| 37 WEBKIT_GLUE_EXPORT void SetJavaScriptFlags(const std::string& flags); | 37 WEBKIT_GLUE_EXPORT void SetJavaScriptFlags(const std::string& flags); |
| 38 | 38 |
| 39 // Turn on logging for flags in the provided comma delimited list. | 39 // Turn on logging for flags in the provided comma delimited list. |
| 40 WEBKIT_GLUE_EXPORT void EnableWebCoreLogChannels(const std::string& channels); | 40 WEBKIT_GLUE_EXPORT void EnableWebCoreLogChannels(const std::string& channels); |
| 41 | 41 |
| 42 // Returns the text of the document element. | 42 // Returns the text of the document element. |
| 43 WEBKIT_GLUE_EXPORT string16 DumpDocumentText(WebKit::WebFrame* web_frame); | 43 WEBKIT_GLUE_EXPORT base::string16 DumpDocumentText(WebKit::WebFrame* web_frame); |
| 44 | 44 |
| 45 // Returns the text of the document element and optionally its child frames. | 45 // Returns the text of the document element and optionally its child frames. |
| 46 // If recursive is false, this is equivalent to DumpDocumentText followed by | 46 // If recursive is false, this is equivalent to DumpDocumentText followed by |
| 47 // a newline. If recursive is true, it recursively dumps all frames as text. | 47 // a newline. If recursive is true, it recursively dumps all frames as text. |
| 48 string16 DumpFramesAsText(WebKit::WebFrame* web_frame, bool recursive); | 48 base::string16 DumpFramesAsText(WebKit::WebFrame* web_frame, bool recursive); |
| 49 | 49 |
| 50 // Returns the renderer's description of its tree (its externalRepresentation). | 50 // Returns the renderer's description of its tree (its externalRepresentation). |
| 51 WEBKIT_GLUE_EXPORT string16 DumpRenderer(WebKit::WebFrame* web_frame); | 51 WEBKIT_GLUE_EXPORT base::string16 DumpRenderer(WebKit::WebFrame* web_frame); |
| 52 | 52 |
| 53 // Returns the number of page where the specified element will be put. | 53 // Returns the number of page where the specified element will be put. |
| 54 int PageNumberForElementById(WebKit::WebFrame* web_frame, | 54 int PageNumberForElementById(WebKit::WebFrame* web_frame, |
| 55 const std::string& id, | 55 const std::string& id, |
| 56 float page_width_in_pixels, | 56 float page_width_in_pixels, |
| 57 float page_height_in_pixels); | 57 float page_height_in_pixels); |
| 58 | 58 |
| 59 // Returns the number of pages to be printed. | 59 // Returns the number of pages to be printed. |
| 60 int NumberOfPages(WebKit::WebFrame* web_frame, | 60 int NumberOfPages(WebKit::WebFrame* web_frame, |
| 61 float page_width_in_pixels, | 61 float page_width_in_pixels, |
| 62 float page_height_in_pixels); | 62 float page_height_in_pixels); |
| 63 | 63 |
| 64 // Returns a dump of the scroll position of the webframe. | 64 // Returns a dump of the scroll position of the webframe. |
| 65 string16 DumpFrameScrollPosition(WebKit::WebFrame* web_frame, bool recursive); | 65 base::string16 DumpFrameScrollPosition(WebKit::WebFrame* web_frame, |
| 66 bool recursive); |
| 66 | 67 |
| 67 // Returns a dump of the given history state suitable for implementing the | 68 // Returns a dump of the given history state suitable for implementing the |
| 68 // dumpBackForwardList command of the testRunner. | 69 // dumpBackForwardList command of the testRunner. |
| 69 WEBKIT_GLUE_EXPORT string16 DumpHistoryState(const std::string& history_state, | 70 WEBKIT_GLUE_EXPORT base::string16 DumpHistoryState( |
| 70 int indent, | 71 const std::string& history_state, |
| 71 bool is_current); | 72 int indent, |
| 73 bool is_current); |
| 72 | 74 |
| 73 #ifndef NDEBUG | 75 #ifndef NDEBUG |
| 74 // Checks various important objects to see if there are any in memory, and | 76 // Checks various important objects to see if there are any in memory, and |
| 75 // calls AppendToLog with any leaked objects. Designed to be called on | 77 // calls AppendToLog with any leaked objects. Designed to be called on |
| 76 // shutdown. | 78 // shutdown. |
| 77 WEBKIT_GLUE_EXPORT void CheckForLeaks(); | 79 WEBKIT_GLUE_EXPORT void CheckForLeaks(); |
| 78 #endif | 80 #endif |
| 79 | 81 |
| 80 // Decodes the image from the data in |image_data| into |image|. | 82 // Decodes the image from the data in |image_data| into |image|. |
| 81 // Returns false if the image could not be decoded. | 83 // Returns false if the image could not be decoded. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // computed inside the sandbox and thus its not always accurate. | 122 // computed inside the sandbox and thus its not always accurate. |
| 121 WEBKIT_GLUE_EXPORT size_t MemoryUsageKB(); | 123 WEBKIT_GLUE_EXPORT size_t MemoryUsageKB(); |
| 122 | 124 |
| 123 // Converts from zoom factor (zoom percent / 100) to zoom level, where 0 means | 125 // Converts from zoom factor (zoom percent / 100) to zoom level, where 0 means |
| 124 // no zoom, positive numbers mean zoom in, negatives mean zoom out. | 126 // no zoom, positive numbers mean zoom in, negatives mean zoom out. |
| 125 WEBKIT_GLUE_EXPORT double ZoomFactorToZoomLevel(double factor); | 127 WEBKIT_GLUE_EXPORT double ZoomFactorToZoomLevel(double factor); |
| 126 | 128 |
| 127 } // namespace webkit_glue | 129 } // namespace webkit_glue |
| 128 | 130 |
| 129 #endif // WEBKIT_GLUE_WEBKIT_GLUE_H_ | 131 #endif // WEBKIT_GLUE_WEBKIT_GLUE_H_ |
| OLD | NEW |