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

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

Issue 1010783002: [Icons NTP] Working prototype to fetch, store, and display big icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/big_icon_url_parser.h
diff --git a/chrome/common/favicon/big_icon_url_parser.h b/chrome/common/favicon/big_icon_url_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..a119400d1b1baa21fc67c587664f2fc7e2ad4e4f
--- /dev/null
+++ b/chrome/common/favicon/big_icon_url_parser.h
@@ -0,0 +1,49 @@
+// 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_BIG_ICON_URL_PARSER_H_
+#define CHROME_COMMON_FAVICON_BIG_ICON_URL_PARSER_H_
+
+#include <string>
+
+#include "base/gtest_prod_util.h"
+#include "base/macros.h"
+
+namespace chrome {
+
+class BigIconUrlParser {
Roger McFarlane (Chromium) 2015/03/16 19:00:59 BigIconUrl... taking the input URL in the construc
+ public:
+ BigIconUrlParser();
+ ~BigIconUrlParser();
+
+ std::string url_string() const { return url_string_; }
+
+ int size_in_pixels() const { return size_in_pixels_; }
+
+ size_t path_index() const { return path_index_; }
+
+ // Parses |path|, which should be in the format described at the top of the
+ // file "chrome/browser/ui/webui/big_icon_source.h".
+ bool Parse(const std::string& path);
+
+ private:
+
+ friend class BigIconUrlParserTest;
+
+ // The page URL string of the fallback icon is requested for.
+ std::string url_string_;
+
+ // The size of the requested fallback icon in pixels.
+ int size_in_pixels_;
+
+ // The index of the first character (relative to the path) where the the URL
+ // from which the big icon is being requested is located.
+ size_t path_index_;
+
+ DISALLOW_COPY_AND_ASSIGN(BigIconUrlParser);
+};
+
+} // namespace chrome
+
+#endif // CHROME_COMMON_FAVICON_BIG_ICON_URL_PARSER_H_

Powered by Google App Engine
This is Rietveld 408576698