blob: ef9bb2224db858ee35f4ec54ac0503f39d982616 [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 "chrome/browser/android/explore_sites/catalog.pb.h"
#include "chrome/browser/android/explore_sites/explore_sites_store.h"
#include "chrome/browser/android/explore_sites/explore_sites_types.h"
#include "components/offline_pages/task/task.h"
using offline_pages::Task;
namespace explore_sites {
// Takes a URL that the user has asked us to remove, and adds it to a blacklist
// of sites we will stop showing in Explore on Sites.
class BlacklistSiteTask : public Task {
BlacklistSiteTask(ExploreSitesStore* store, std::string url);
~BlacklistSiteTask() override;
bool complete() const { return complete_; }
bool result() const { return result_; }
// Task implementation:
void Run() override;
void FinishedExecuting(bool result);
ExploreSitesStore* store_; // outlives this class.
std::string url_;
bool complete_ = false;
bool result_ = false;
BooleanCallback callback_;
base::WeakPtrFactory<BlacklistSiteTask> weak_ptr_factory_;
} // namespace explore_sites