Chromium Code Reviews| Index: chrome/common/favicon/fallback_icon_url_parser.h |
| diff --git a/chrome/common/favicon/fallback_icon_url_parser.h b/chrome/common/favicon/fallback_icon_url_parser.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b0b559e00a8f4df716b4385cb558b784ce955adf |
| --- /dev/null |
| +++ b/chrome/common/favicon/fallback_icon_url_parser.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2015 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 CHROME_COMMON_FAVICON_FALLBACK_ICON_URL_PARSER_H_ |
| +#define CHROME_COMMON_FAVICON_FALLBACK_ICON_URL_PARSER_H_ |
| + |
| +#include <string> |
| + |
|
pkotwicz
2015/01/23 16:00:47
Nit: No need to include favicon_types.h
huangs
2015/01/23 19:47:51
Need this for favicon_base::FallbackIconStyle , wh
|
| +#include "components/favicon_base/favicon_types.h" |
| +#include "third_party/skia/include/core/SkColor.h" |
| + |
| +namespace chrome { |
| + |
| +struct ParsedFallbackIconPath { |
| + // The URL from which the fallback icon is being requested. |
|
pkotwicz
2015/01/23 16:00:47
How about: "The page URL the fallback icon is requ
huangs
2015/01/23 19:47:51
Done.
|
| + std::string url; |
| + |
| + // The size of the requested fallback icon in pixels. |
| + int size_in_pixels; |
| + |
| + // Specifications of fallback icon. This is nullptr if no fallback. |
|
pkotwicz
2015/01/23 16:00:47
Remove the part about the nullptr because it is no
huangs
2015/01/23 19:47:51
Done.
|
| + favicon_base::FallbackIconStyle style; |
| +}; |
| + |
| +// Parses a color in "RGB", "RRGGBB", or "RRGGBBAA" format. Returns true on |
| +// success. |
| +bool ParseIconColor(const std::string& str, SkColor* color); |
| + |
| + |
| +// Parses |specs_str|, which should be the comma-separated value portion |
| +// in the format described at the top of the file |
| +// "chrome/browser/ui/webui/fallback_icon_source.h". |
| +bool ParseFallbackIconSpecs(const std::string& specs_str, |
| + int *size, |
| + favicon_base::FallbackIconStyle* style); |
| + |
| +// Parses |path|, which should be in the format described at the top of the |
| +// file "chrome/browser/ui/webui/fallback_icon_source.h". |
| +bool ParseFallbackIconPath(const std::string& path, |
| + ParsedFallbackIconPath* parsed); |
| + |
| +} // namespace chrome |
| + |
| +#endif // CHROME_COMMON_FAVICON_FALLBACK_ICON_URL_PARSER_H_ |