Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: chrome/common/favicon/favicon_url_parser.h

Issue 15388002: Supporting high dpi favicons in Instant Extended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/favicon/favicon_url_parser.h
diff --git a/chrome/common/favicon/favicon_url_parser.h b/chrome/common/favicon/favicon_url_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..73d28d1726178874e196e94bc86ba897a6391dd3
--- /dev/null
+++ b/chrome/common/favicon/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_FAVICON_URL_PARSER_H_
+#define CHROME_COMMON_FAVICON_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;
+ // 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_FAVICON_URL_PARSER_H_

Powered by Google App Engine
This is Rietveld 408576698