summaryrefslogtreecommitdiffstats
path: root/components/favicon_base/favicon_url_parser.h
diff options
context:
space:
mode:
authorblundell <blundell@chromium.org>2015-07-08 03:07:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-08 10:08:22 +0000
commitee0ade20e42f6ff67ec7402c80610e3d0b7f960a (patch)
tree60056d8d047c4bf82f6bf31ce0ec8ca286ef268c /components/favicon_base/favicon_url_parser.h
parent0c714f7ca6d4f027501aa8ef8ae91ebc99788b62 (diff)
downloadchromium_src-ee0ade20e42f6ff67ec7402c80610e3d0b7f960a.zip
chromium_src-ee0ade20e42f6ff67ec7402c80610e3d0b7f960a.tar.gz
chromium_src-ee0ade20e42f6ff67ec7402c80610e3d0b7f960a.tar.bz2
Componentize //chrome/common/favicon
This code is used by iOS; move it into //components/favicon_base. TBR=sky, rdsmith Review URL: https://codereview.chromium.org/1223603002 Cr-Commit-Position: refs/heads/master@{#337794}
Diffstat (limited to 'components/favicon_base/favicon_url_parser.h')
-rw-r--r--components/favicon_base/favicon_url_parser.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/components/favicon_base/favicon_url_parser.h b/components/favicon_base/favicon_url_parser.h
new file mode 100644
index 0000000..c1d3f022
--- /dev/null
+++ b/components/favicon_base/favicon_url_parser.h
@@ -0,0 +1,40 @@
+// 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 <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_