1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_FAVICON_LARGE_ICON_URL_PARSER_H_
6 #define CHROME_COMMON_FAVICON_LARGE_ICON_URL_PARSER_H_
10 #include "base/macros.h"
11 #include "base/strings/string_piece.h"
13 // A parser for parameters to the chrome://large-icon/ host.
14 class LargeIconUrlParser
{
17 ~LargeIconUrlParser();
19 std::string
url_string() const { return url_string_
; }
21 int size_in_pixels() const { return size_in_pixels_
; }
23 size_t path_index() const { return path_index_
; }
25 // Parses |path|, which should be in the format described at the top of the
26 // file "chrome/browser/ui/webui/large_icon_source.h". Note that |path| does
27 // not have leading '/'.
28 bool Parse(base::StringPiece path
);
31 friend class LargeIconUrlParserTest
;
33 // The page URL string of the requested large icon.
34 std::string url_string_
;
36 // The size of the requested large icon in pixels.
39 // The index of the first character (relative to the path) where the the URL
40 // from which the large icon is being requested is located.
43 DISALLOW_COPY_AND_ASSIGN(LargeIconUrlParser
);
46 #endif // CHROME_COMMON_FAVICON_LARGE_ICON_URL_PARSER_H_