[email protected] | 93f5046 | 2013-05-10 04:40:40 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef CHROME_RENDERER_WEB_APPS_H_ | ||||
6 | #define CHROME_RENDERER_WEB_APPS_H_ | ||||
7 | |||||
8 | #include <string> | ||||
9 | #include <vector> | ||||
10 | |||||
[email protected] | a19a16d8 | 2013-06-11 17:45:12 | [diff] [blame] | 11 | #include "base/strings/string16.h" |
[email protected] | 93f5046 | 2013-05-10 04:40:40 | [diff] [blame] | 12 | #include "ui/gfx/size.h" |
13 | |||||
[email protected] | a1221aea | 2013-11-07 01:31:30 | [diff] [blame] | 14 | namespace blink { |
[email protected] | 93f5046 | 2013-05-10 04:40:40 | [diff] [blame] | 15 | class WebFrame; |
16 | } | ||||
17 | |||||
18 | struct WebApplicationInfo; | ||||
19 | |||||
20 | namespace web_apps { | ||||
21 | |||||
22 | // Parses the icon's size attribute as defined in the HTML 5 spec. Returns true | ||||
23 | // on success, false on errors. On success either all the sizes specified in | ||||
24 | // the attribute are added to sizes, or is_any is set to true. | ||||
25 | // | ||||
26 | // You shouldn't have a need to invoke this directly, it's public for testing. | ||||
[email protected] | 12469f9 | 2013-12-04 22:50:07 | [diff] [blame] | 27 | bool ParseIconSizes(const base::string16& text, std::vector<gfx::Size>* sizes, |
[email protected] | 93f5046 | 2013-05-10 04:40:40 | [diff] [blame] | 28 | bool* is_any); |
29 | |||||
30 | // Parses |web_app| information out of the document in frame. Returns true on | ||||
31 | // success, or false and |error| on failure. Note that the document may contain | ||||
32 | // no web application information, in which case |web_app| is unchanged and the | ||||
33 | // function returns true. | ||||
34 | // | ||||
35 | // Documents can also contain a link to a application 'definition'. In this case | ||||
36 | // web_app will have manifest_url set and nothing else. The caller must fetch | ||||
37 | // this URL and pass the result to ParseWebAppFromDefinitionFile() for further | ||||
38 | // processing. | ||||
[email protected] | a1221aea | 2013-11-07 01:31:30 | [diff] [blame] | 39 | bool ParseWebAppFromWebDocument(blink::WebFrame* frame, |
[email protected] | 93f5046 | 2013-05-10 04:40:40 | [diff] [blame] | 40 | WebApplicationInfo* web_app, |
[email protected] | 12469f9 | 2013-12-04 22:50:07 | [diff] [blame] | 41 | base::string16* error); |
[email protected] | 93f5046 | 2013-05-10 04:40:40 | [diff] [blame] | 42 | |
43 | } // namespace web_apps | ||||
44 | |||||
45 | #endif // CHROME_RENDERER_WEB_APPS_H_ |