forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfavicon_url_parser.h
42 lines (30 loc) · 1.31 KB
/
favicon_url_parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_FAVICON_BASE_FAVICON_URL_PARSER_H_
#define COMPONENTS_FAVICON_BASE_FAVICON_URL_PARSER_H_
#include <stddef.h>
#include <string>
namespace chrome {
struct ParsedFaviconPath {
// Whether the URL has the "iconurl" parameter.
bool is_icon_url;
// The URL from which the favicon is being requested.
std::string url;
// The size of the requested favicon in dip.
int size_in_dip;
// The device scale factor of the requested favicon.
float device_scale_factor;
// The index of the first character (relative to the path) where the the URL
// from which the favicon is being requested is located.
size_t path_index;
};
// Parses |path|, which should be in the format described at the top of the
// file "chrome/browser/ui/webui/favicon_source.h". |icon_types| indicates
// which icon types are supported. Returns true if |path| could be parsed.
// The result of the parsing will be stored in a ParsedFaviconPath struct.
bool ParseFaviconPath(const std::string& path,
int icon_types,
ParsedFaviconPath* parsed);
} // namespace chrome
#endif // COMPONENTS_FAVICON_BASE_FAVICON_URL_PARSER_H_