blob: 21caea35afeebd342622f3358fffc53f1dc2c226 [file] [log] [blame]
sfiera635d21d2016-08-04 07:56:091// 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"
Mikel Astiza0f98cc2017-10-12 19:48:4813#include "base/time/time.h"
treib231212e2017-04-04 17:09:2214#include "components/ntp_tiles/tile_source.h"
Friedrich Horschigefec0812017-09-28 18:50:1715#include "components/ntp_tiles/tile_title_source.h"
sfiera635d21d2016-08-04 07:56:0916#include "url/gurl.h"
17
18namespace ntp_tiles {
19
sfiera635d21d2016-08-04 07:56:0920// A suggested site shown on the New Tab Page.
21struct NTPTile {
22 base::string16 title;
23 GURL url;
Friedrich Horschigefec0812017-09-28 18:50:1724 TileTitleSource title_source;
treib231212e2017-04-04 17:09:2225 TileSource source;
sfiera635d21d2016-08-04 07:56:0926
sfiera51fb9812016-12-08 18:36:0227 // Empty unless whitelists are enabled and this site is in a whitelist.
28 // However, may be non-empty even if |source| is not |WHITELIST|, if this tile
29 // is also available from another, higher-priority source.
sfiera635d21d2016-08-04 07:56:0930 base::FilePath whitelist_icon_path;
31
treibbb0c5af52016-12-09 17:34:1532 // This won't be empty, but might 404 etc.
33 GURL favicon_url;
34
Mikel Astiza0f98cc2017-10-12 19:48:4835 // Timestamp representing when the tile was originally generated (produced by
36 // a ranking algorithm).
37 base::Time data_generation_time;
38
Kristi Parke0e9f512019-03-01 23:26:0439 // True if this tile is a custom link and was initialized from a Most Visited
40 // item. Used for debugging.
41 bool from_most_visited = false;
42
sfiera635d21d2016-08-04 07:56:0943 NTPTile();
sfiera08b57f82016-09-22 10:14:2744 NTPTile(const NTPTile&);
sfiera635d21d2016-08-04 07:56:0945 ~NTPTile();
sfiera635d21d2016-08-04 07:56:0946};
47
sfiera3140e142017-03-07 16:00:4848bool operator==(const NTPTile& a, const NTPTile& b);
49bool operator!=(const NTPTile& a, const NTPTile& b);
50
sfiera635d21d2016-08-04 07:56:0951using NTPTilesVector = std::vector<NTPTile>;
52
53} // namespace ntp_tiles
54
55#endif // COMPONENTS_NTP_TILES_NTP_TILE_H_