OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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_COMMON_FAVICON_FALLBACK_ICON_URL_PARSER_H_ | |
6 #define CHROME_COMMON_FAVICON_FALLBACK_ICON_URL_PARSER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "components/favicon_base/fallback_icon_style.h" | |
11 #include "third_party/skia/include/core/SkColor.h" | |
cpu_(ooo_6.6-7.5)
2015/02/19 03:49:19
can you use a fwd decl instead of #include ?
huangs
2015/02/20 16:06:45
SkColor is a typedef:
typedef uint32_t SkColor;
| |
12 | |
13 namespace chrome { | |
14 | |
15 struct ParsedFallbackIconPath { | |
16 // The page URL the fallback icon is requested for. | |
17 std::string url; | |
cpu_(ooo_6.6-7.5)
2015/02/19 03:49:19
we usually don't have strings doing url jobs. use
huangs
2015/02/20 16:06:45
I'm following the style of the matching file favic
| |
18 | |
19 // The size of the requested fallback icon in pixels. | |
20 int size_in_pixels; | |
cpu_(ooo_6.6-7.5)
2015/02/19 03:49:18
can you have a negative size? if not use size_t or
huangs
2015/02/20 16:06:45
Will use size_t.
huangs
2015/02/20 20:39:32
On second thought, this is int because all favicon
| |
21 | |
22 // Styling specifications of fallback icon. | |
23 favicon_base::FallbackIconStyle style; | |
24 }; | |
25 | |
26 // Parses a color in "RGB", "RRGGBB", or "RRGGBBAA" format. Returns true on | |
27 // success. | |
28 bool ParseIconColor(const std::string& str, SkColor* color); | |
cpu_(ooo_6.6-7.5)
2015/02/19 03:49:18
this function seems out of place, also |str| shoul
huangs
2015/02/20 16:06:45
How about using SkParse::FindColor()? It will chan
| |
29 | |
30 | |
31 // Parses |specs_str|, which should be the comma-separated value portion | |
32 // in the format described at the top of the file | |
33 // "chrome/browser/ui/webui/fallback_icon_source.h". | |
34 bool ParseFallbackIconSpecs(const std::string& specs_str, | |
35 int *size, | |
36 favicon_base::FallbackIconStyle* style); | |
cpu_(ooo_6.6-7.5)
2015/02/19 03:49:18
you seem to be returning 2 of the 3 items in Parse
huangs
2015/02/20 16:06:45
Will take the latter case. I suppose specific uni
| |
37 | |
38 // Parses |path|, which should be in the format described at the top of the | |
39 // file "chrome/browser/ui/webui/fallback_icon_source.h". | |
40 bool ParseFallbackIconPath(const std::string& path, | |
41 ParsedFallbackIconPath* parsed); | |
42 | |
43 } // namespace chrome | |
44 | |
45 #endif // CHROME_COMMON_FAVICON_FALLBACK_ICON_URL_PARSER_H_ | |
OLD | NEW |