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" | 11 #include "gfx/size.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "third_party/skia/include/core/SkBitmap.h" |
13 | 14 |
14 namespace WebKit { | 15 namespace WebKit { |
15 class WebDocument; | 16 class WebDocument; |
16 class WebElement; | 17 class WebElement; |
17 class WebString; | 18 class WebString; |
18 class WebView; | 19 class WebView; |
19 } | 20 } |
20 | 21 |
21 // A collection of operations that access the underlying WebKit DOM directly. | 22 // A collection of operations that access the underlying WebKit DOM directly. |
22 namespace webkit_glue { | 23 namespace webkit_glue { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Structure used when installing a web page as an app. Populated via | 65 // Structure used when installing a web page as an app. Populated via |
65 // GetApplicationInfo. | 66 // GetApplicationInfo. |
66 struct WebApplicationInfo { | 67 struct WebApplicationInfo { |
67 WebApplicationInfo(); | 68 WebApplicationInfo(); |
68 ~WebApplicationInfo(); | 69 ~WebApplicationInfo(); |
69 | 70 |
70 struct IconInfo { | 71 struct IconInfo { |
71 GURL url; | 72 GURL url; |
72 int width; | 73 int width; |
73 int height; | 74 int height; |
| 75 SkBitmap data; |
74 }; | 76 }; |
75 | 77 |
76 // Title of the application. This is set from the meta tag whose name is | 78 // URL to a manifest that defines the application. If specified, all other |
77 // 'application-name'. | 79 // attributes are derived from this manifest, and the manifest is the unique |
| 80 // ID of the application. |
| 81 GURL manifest_url; |
| 82 |
| 83 // Title of the application. |
78 string16 title; | 84 string16 title; |
79 | 85 |
80 // Description of the application. This is set from the meta tag whose name | 86 // Description of the application. |
81 // is 'description'. | |
82 string16 description; | 87 string16 description; |
83 | 88 |
84 // URL for the app. This is set from the meta tag whose name is | 89 // The launch URL for the app. |
85 // 'application-url'. | |
86 GURL app_url; | 90 GURL app_url; |
87 | 91 |
88 // Set of available icons. This is set for all link tags whose rel=icon. Only | 92 // Set of available icons. |
89 // icons that have a non-zero (width and/or height) are added. | |
90 std::vector<IconInfo> icons; | 93 std::vector<IconInfo> icons; |
| 94 |
| 95 // The permissions the app requests. Only supported with manifest-based apps. |
| 96 std::vector<std::string> permissions; |
| 97 |
| 98 // Set of URLs that comprise the app. Only supported with manifest-based apps. |
| 99 // All these must be of the same origin as manifest_url. |
| 100 std::vector<GURL> urls; |
91 }; | 101 }; |
92 | 102 |
93 // Parses the icon's size attribute as defined in the HTML 5 spec. Returns true | 103 // Parses the icon's size attribute as defined in the HTML 5 spec. Returns true |
94 // on success, false on errors. On success either all the sizes specified in | 104 // on success, false on errors. On success either all the sizes specified in |
95 // the attribute are added to sizes, or is_any is set to true. | 105 // the attribute are added to sizes, or is_any is set to true. |
96 // | 106 // |
97 // You shouldn't have a need to invoke this directly, it's public for testing. | 107 // You shouldn't have a need to invoke this directly, it's public for testing. |
98 bool ParseIconSizes(const string16& text, | 108 bool ParseIconSizes(const string16& text, |
99 std::vector<gfx::Size>* sizes, | 109 std::vector<gfx::Size>* sizes, |
100 bool* is_any); | 110 bool* is_any); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // with a value of |attribute_value| in |meta_elements|. | 149 // with a value of |attribute_value| in |meta_elements|. |
140 void GetMetaElementsWithAttribute( | 150 void GetMetaElementsWithAttribute( |
141 WebKit::WebDocument* document, | 151 WebKit::WebDocument* document, |
142 const string16& attribute_name, | 152 const string16& attribute_name, |
143 const string16& atribute_value, | 153 const string16& atribute_value, |
144 std::vector<WebKit::WebElement>* meta_elements); | 154 std::vector<WebKit::WebElement>* meta_elements); |
145 | 155 |
146 } // namespace webkit_glue | 156 } // namespace webkit_glue |
147 | 157 |
148 #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__ | 158 #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__ |
OLD | NEW |