| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DOM_OPERATIONS_H__ | 5 #ifndef WEBKIT_GLUE_DOM_OPERATIONS_H__ |
| 6 #define WEBKIT_GLUE_DOM_OPERATIONS_H__ | 6 #define WEBKIT_GLUE_DOM_OPERATIONS_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "gfx/size.h" | |
| 12 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 13 #include "third_party/skia/include/core/SkBitmap.h" | |
| 14 | 12 |
| 15 namespace WebKit { | 13 namespace WebKit { |
| 16 class WebDocument; | 14 class WebDocument; |
| 17 class WebElement; | 15 class WebElement; |
| 18 class WebString; | 16 class WebString; |
| 19 class WebView; | 17 class WebView; |
| 20 } | 18 } |
| 21 | 19 |
| 22 // A collection of operations that access the underlying WebKit DOM directly. | 20 // A collection of operations that access the underlying WebKit DOM directly. |
| 23 namespace webkit_glue { | 21 namespace webkit_glue { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 // Get all savable resource links from current webview, include main frame | 48 // Get all savable resource links from current webview, include main frame |
| 51 // and sub-frame. After collecting all savable resource links, this function | 49 // and sub-frame. After collecting all savable resource links, this function |
| 52 // will send those links to embedder. Return value indicates whether we get | 50 // will send those links to embedder. Return value indicates whether we get |
| 53 // all saved resource links successfully. | 51 // all saved resource links successfully. |
| 54 bool GetAllSavableResourceLinksForCurrentPage(WebKit::WebView* view, | 52 bool GetAllSavableResourceLinksForCurrentPage(WebKit::WebView* view, |
| 55 const GURL& page_url, SavableResourcesResult* savable_resources_result, | 53 const GURL& page_url, SavableResourcesResult* savable_resources_result, |
| 56 const char** savable_schemes); | 54 const char** savable_schemes); |
| 57 | 55 |
| 58 // Structure used when installing a web page as an app. Populated via | |
| 59 // GetApplicationInfo. | |
| 60 struct WebApplicationInfo { | |
| 61 WebApplicationInfo(); | |
| 62 ~WebApplicationInfo(); | |
| 63 | |
| 64 struct IconInfo { | |
| 65 GURL url; | |
| 66 int width; | |
| 67 int height; | |
| 68 SkBitmap data; | |
| 69 }; | |
| 70 | |
| 71 // URL to a manifest that defines the application. If specified, all other | |
| 72 // attributes are derived from this manifest, and the manifest is the unique | |
| 73 // ID of the application. | |
| 74 GURL manifest_url; | |
| 75 | |
| 76 // Title of the application. | |
| 77 string16 title; | |
| 78 | |
| 79 // Description of the application. | |
| 80 string16 description; | |
| 81 | |
| 82 // The launch URL for the app. | |
| 83 GURL app_url; | |
| 84 | |
| 85 // Set of available icons. | |
| 86 std::vector<IconInfo> icons; | |
| 87 | |
| 88 // The permissions the app requests. Only supported with manifest-based apps. | |
| 89 std::vector<std::string> permissions; | |
| 90 | |
| 91 // Set of URLs that comprise the app. Only supported with manifest-based apps. | |
| 92 // All these must be of the same origin as manifest_url. | |
| 93 std::vector<GURL> urls; | |
| 94 }; | |
| 95 | |
| 96 // Parses the icon's size attribute as defined in the HTML 5 spec. Returns true | |
| 97 // on success, false on errors. On success either all the sizes specified in | |
| 98 // the attribute are added to sizes, or is_any is set to true. | |
| 99 // | |
| 100 // You shouldn't have a need to invoke this directly, it's public for testing. | |
| 101 bool ParseIconSizes(const string16& text, | |
| 102 std::vector<gfx::Size>* sizes, | |
| 103 bool* is_any); | |
| 104 | |
| 105 // Gets the application info for the specified page. See the description of | |
| 106 // WebApplicationInfo for details as to where each field comes from. | |
| 107 void GetApplicationInfo(WebKit::WebView* view, WebApplicationInfo* app_info); | |
| 108 | |
| 109 // Invokes pauseAnimationAtTime on the AnimationController associated with the | 56 // Invokes pauseAnimationAtTime on the AnimationController associated with the |
| 110 // |view|s main frame. | 57 // |view|s main frame. |
| 111 // This is used by test shell. | 58 // This is used by test shell. |
| 112 bool PauseAnimationAtTimeOnElementWithId(WebKit::WebView* view, | 59 bool PauseAnimationAtTimeOnElementWithId(WebKit::WebView* view, |
| 113 const std::string& animation_name, | 60 const std::string& animation_name, |
| 114 double time, | 61 double time, |
| 115 const std::string& element_id); | 62 const std::string& element_id); |
| 116 | 63 |
| 117 // Invokes pauseTransitionAtTime on the AnimationController associated with the | 64 // Invokes pauseTransitionAtTime on the AnimationController associated with the |
| 118 // |view|s main frame. | 65 // |view|s main frame. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 142 // with a value of |attribute_value| in |meta_elements|. | 89 // with a value of |attribute_value| in |meta_elements|. |
| 143 void GetMetaElementsWithAttribute( | 90 void GetMetaElementsWithAttribute( |
| 144 WebKit::WebDocument* document, | 91 WebKit::WebDocument* document, |
| 145 const string16& attribute_name, | 92 const string16& attribute_name, |
| 146 const string16& atribute_value, | 93 const string16& atribute_value, |
| 147 std::vector<WebKit::WebElement>* meta_elements); | 94 std::vector<WebKit::WebElement>* meta_elements); |
| 148 | 95 |
| 149 } // namespace webkit_glue | 96 } // namespace webkit_glue |
| 150 | 97 |
| 151 #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__ | 98 #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__ |
| OLD | NEW |