Chromium Code Reviews| Index: chrome/common/favicon_url_parser.h |
| diff --git a/chrome/common/favicon_url_parser.h b/chrome/common/favicon_url_parser.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..50f3a4ce1c3d2b13516ba6442ab3b4a7b3b4e6b3 |
| --- /dev/null |
| +++ b/chrome/common/favicon_url_parser.h |
| @@ -0,0 +1,38 @@ |
| +// 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 CHROME_COMMON_FAVICON_URL_PARSER_H_ |
| +#define CHROME_COMMON_FAVICON_URL_PARSER_H_ |
| + |
| +#include <string> |
| + |
| +#include "ui/base/layout.h" |
| + |
| +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; |
|
Evan Stade
2013/06/24 18:56:23
why is this not a GURL?
pedro (no code reviews)
2013/06/27 21:26:30
Favicons URLs in Instant Extended do not have the
|
| + // The size of the requested favicon |
| + int size_in_dip; |
| + // The scale factor of the requested favicon |
| + ui::ScaleFactor 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 // CHROME_COMMON_FAVICON_URL_PARSER_H_ |