blob: 0f1ad10a9f25364ffd7d4d7852ecbf2e8567eb8d [file] [log] [blame]
// Copyright 2018 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.
#include <string>
#include <utility>
#include <vector>
#include "url/gurl.h"
namespace base {
class DictionaryValue;
namespace explore_sites {
// A representation of the Explore Sites catalog on the NTP.
class NTPCatalog {
// Categories are mapped to individual tiles on the NTP.
struct Category {
// The category ID, used as a section identifier when opening the full
// explore sites catalog.
std::string id;
// The textual name of the category.
std::string title;
// The icon image URL.
GURL icon_url;
// The NTPCatalog does not take ownership of |json|.
static std::unique_ptr<NTPCatalog> create(const base::DictionaryValue* json);
explicit NTPCatalog(const std::vector<Category>& category_list);
std::vector<Category> categories;
std::string ToString();
bool operator==(const NTPCatalog::Category& a, const NTPCatalog::Category& b);
bool operator==(const NTPCatalog& a, const NTPCatalog& b);
} // namespace explore_sites