sfiera | 635d21d | 2016-08-04 07:56:09 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef COMPONENTS_NTP_TILES_NTP_TILE_H_ |
| 6 | #define COMPONENTS_NTP_TILES_NTP_TILE_H_ |
| 7 | |
| 8 | #include <vector> |
| 9 | |
| 10 | #include "base/files/file_path.h" |
| 11 | #include "base/macros.h" |
| 12 | #include "base/strings/string16.h" |
treib | 3168fe0 | 2016-12-05 16:20:25 | [diff] [blame] | 13 | #include "components/ntp_tiles/ntp_tile_source.h" |
sfiera | 635d21d | 2016-08-04 07:56:09 | [diff] [blame] | 14 | #include "url/gurl.h" |
| 15 | |
| 16 | namespace ntp_tiles { |
| 17 | |
sfiera | 635d21d | 2016-08-04 07:56:09 | [diff] [blame] | 18 | // A suggested site shown on the New Tab Page. |
| 19 | struct NTPTile { |
| 20 | base::string16 title; |
| 21 | GURL url; |
| 22 | NTPTileSource source; |
| 23 | |
sfiera | 51fb981 | 2016-12-08 18:36:02 | [diff] [blame] | 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 |
| 26 | // is also available from another, higher-priority source. |
sfiera | 635d21d | 2016-08-04 07:56:09 | [diff] [blame] | 27 | base::FilePath whitelist_icon_path; |
| 28 | |
treib | bb0c5af5 | 2016-12-09 17:34:15 | [diff] [blame] | 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. |
| 31 | GURL thumbnail_url; |
| 32 | // This won't be empty, but might 404 etc. |
| 33 | GURL favicon_url; |
| 34 | |
sfiera | 635d21d | 2016-08-04 07:56:09 | [diff] [blame] | 35 | NTPTile(); |
sfiera | 08b57f8 | 2016-09-22 10:14:27 | [diff] [blame] | 36 | NTPTile(const NTPTile&); |
sfiera | 635d21d | 2016-08-04 07:56:09 | [diff] [blame] | 37 | ~NTPTile(); |
sfiera | 635d21d | 2016-08-04 07:56:09 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | using NTPTilesVector = std::vector<NTPTile>; |
| 41 | |
| 42 | } // namespace ntp_tiles |
| 43 | |
| 44 | #endif // COMPONENTS_NTP_TILES_NTP_TILE_H_ |