Roll src/third_party/WebKit 6f84130:7353389 (svn 184386:184391)
[chromium-blink-merge.git] / chrome / common / favicon / favicon_url_parser.h
blobd7de77080a89e455c09ee6dbc8e18becba9fd981
1 // Copyright 2013 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.
5 #ifndef CHROME_COMMON_FAVICON_FAVICON_URL_PARSER_H_
6 #define CHROME_COMMON_FAVICON_FAVICON_URL_PARSER_H_
8 #include <string>
10 namespace chrome {
12 struct ParsedFaviconPath {
13 // Whether the URL has the "iconurl" parameter.
14 bool is_icon_url;
16 // The URL from which the favicon is being requested.
17 std::string url;
19 // The size of the requested favicon in dip.
20 int size_in_dip;
22 // The device scale factor of the requested favicon.
23 float device_scale_factor;
25 // The index of the first character (relative to the path) where the the URL
26 // from which the favicon is being requested is located.
27 size_t path_index;
30 // Parses |path|, which should be in the format described at the top of the
31 // file "chrome/browser/ui/webui/favicon_source.h". |icon_types| indicates
32 // which icon types are supported. Returns true if |path| could be parsed.
33 // The result of the parsing will be stored in a ParsedFaviconPath struct.
34 bool ParseFaviconPath(const std::string& path,
35 int icon_types,
36 ParsedFaviconPath* parsed);
38 } // namespace chrome
40 #endif // CHROME_COMMON_FAVICON_FAVICON_URL_PARSER_H_