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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Structure used when installing a web page as an app. Populated via | 58 // Structure used when installing a web page as an app. Populated via |
58 // GetApplicationInfo. | 59 // GetApplicationInfo. |
59 struct WebApplicationInfo { | 60 struct WebApplicationInfo { |
60 WebApplicationInfo(); | 61 WebApplicationInfo(); |
61 ~WebApplicationInfo(); | 62 ~WebApplicationInfo(); |
62 | 63 |
63 struct IconInfo { | 64 struct IconInfo { |
64 GURL url; | 65 GURL url; |
65 int width; | 66 int width; |
66 int height; | 67 int height; |
| 68 SkBitmap data; |
67 }; | 69 }; |
68 | 70 |
69 // Title of the application. This is set from the meta tag whose name is | 71 // URL to a manifest that defines the application. If specified, all other |
70 // 'application-name'. | 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. |
71 string16 title; | 77 string16 title; |
72 | 78 |
73 // Description of the application. This is set from the meta tag whose name | 79 // Description of the application. |
74 // is 'description'. | |
75 string16 description; | 80 string16 description; |
76 | 81 |
77 // URL for the app. This is set from the meta tag whose name is | 82 // The launch URL for the app. |
78 // 'application-url'. | |
79 GURL app_url; | 83 GURL app_url; |
80 | 84 |
81 // Set of available icons. This is set for all link tags whose rel=icon. Only | 85 // Set of available icons. |
82 // icons that have a non-zero (width and/or height) are added. | |
83 std::vector<IconInfo> 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; |
84 }; | 94 }; |
85 | 95 |
86 // Parses the icon's size attribute as defined in the HTML 5 spec. Returns true | 96 // Parses the icon's size attribute as defined in the HTML 5 spec. Returns true |
87 // on success, false on errors. On success either all the sizes specified in | 97 // on success, false on errors. On success either all the sizes specified in |
88 // the attribute are added to sizes, or is_any is set to true. | 98 // the attribute are added to sizes, or is_any is set to true. |
89 // | 99 // |
90 // You shouldn't have a need to invoke this directly, it's public for testing. | 100 // You shouldn't have a need to invoke this directly, it's public for testing. |
91 bool ParseIconSizes(const string16& text, | 101 bool ParseIconSizes(const string16& text, |
92 std::vector<gfx::Size>* sizes, | 102 std::vector<gfx::Size>* sizes, |
93 bool* is_any); | 103 bool* is_any); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // with a value of |attribute_value| in |meta_elements|. | 142 // with a value of |attribute_value| in |meta_elements|. |
133 void GetMetaElementsWithAttribute( | 143 void GetMetaElementsWithAttribute( |
134 WebKit::WebDocument* document, | 144 WebKit::WebDocument* document, |
135 const string16& attribute_name, | 145 const string16& attribute_name, |
136 const string16& atribute_value, | 146 const string16& atribute_value, |
137 std::vector<WebKit::WebElement>* meta_elements); | 147 std::vector<WebKit::WebElement>* meta_elements); |
138 | 148 |
139 } // namespace webkit_glue | 149 } // namespace webkit_glue |
140 | 150 |
141 #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__ | 151 #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__ |
OLD | NEW |