OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_NTP_TILES_NTP_TILE_H_ | 5 #ifndef COMPONENTS_NTP_TILES_NTP_TILE_H_ |
6 #define COMPONENTS_NTP_TILES_NTP_TILE_H_ | 6 #define COMPONENTS_NTP_TILES_NTP_TILE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "components/ntp_tiles/ntp_tile_source.h" | 13 #include "components/ntp_tiles/tile_source.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace ntp_tiles { | 16 namespace ntp_tiles { |
17 | 17 |
18 // A suggested site shown on the New Tab Page. | 18 // A suggested site shown on the New Tab Page. |
19 struct NTPTile { | 19 struct NTPTile { |
20 base::string16 title; | 20 base::string16 title; |
21 GURL url; | 21 GURL url; |
22 NTPTileSource source; | 22 TileSource source; |
23 | 23 |
24 // Empty unless whitelists are enabled and this site is in a whitelist. | 24 // Empty unless whitelists are enabled and this site is in a whitelist. |
25 // However, may be non-empty even if |source| is not |WHITELIST|, if this tile | 25 // However, may be non-empty even if |source| is not |WHITELIST|, if this tile |
26 // is also available from another, higher-priority source. | 26 // is also available from another, higher-priority source. |
27 base::FilePath whitelist_icon_path; | 27 base::FilePath whitelist_icon_path; |
28 | 28 |
29 // Only valid for source == SUGGESTIONS_SERVICE (empty otherwise). | 29 // Only valid for source == SUGGESTIONS_SERVICE (empty otherwise). |
30 // May point to a local chrome:// URL or to a remote one. May be empty. | 30 // May point to a local chrome:// URL or to a remote one. May be empty. |
31 GURL thumbnail_url; | 31 GURL thumbnail_url; |
32 // This won't be empty, but might 404 etc. | 32 // This won't be empty, but might 404 etc. |
33 GURL favicon_url; | 33 GURL favicon_url; |
34 | 34 |
35 NTPTile(); | 35 NTPTile(); |
36 NTPTile(const NTPTile&); | 36 NTPTile(const NTPTile&); |
37 ~NTPTile(); | 37 ~NTPTile(); |
38 }; | 38 }; |
39 | 39 |
40 bool operator==(const NTPTile& a, const NTPTile& b); | 40 bool operator==(const NTPTile& a, const NTPTile& b); |
41 bool operator!=(const NTPTile& a, const NTPTile& b); | 41 bool operator!=(const NTPTile& a, const NTPTile& b); |
42 | 42 |
43 using NTPTilesVector = std::vector<NTPTile>; | 43 using NTPTilesVector = std::vector<NTPTile>; |
44 | 44 |
45 } // namespace ntp_tiles | 45 } // namespace ntp_tiles |
46 | 46 |
47 #endif // COMPONENTS_NTP_TILES_NTP_TILE_H_ | 47 #endif // COMPONENTS_NTP_TILES_NTP_TILE_H_ |
OLD | NEW |