blob: 1436f40b6e4f4de6f0c32ddd599fc94c3efd622c [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.
#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_OBSERVER_H_
#define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_OBSERVER_H_
#include <memory>
class SkBitmap;
namespace content {
struct BackgroundFetchOptions;
struct BackgroundFetchRegistration;
class BackgroundFetchRegistrationId;
// Observer interface for objects that would like to be notified about changes
// committed to storage through the Background Fetch data manager. All methods
// will be invoked on the IO thread.
class BackgroundFetchDataManagerObserver {
public:
// Called when the Background Fetch |registration| has been created.
virtual void OnRegistrationCreated(
const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchRegistration& registration,
const BackgroundFetchOptions& options,
const SkBitmap& icon,
int num_requests) = 0;
// Called when the |title| for the Background Fetch |registration_id| has been
// updated in the data store.
virtual void OnUpdatedUI(const BackgroundFetchRegistrationId& registration_id,
const std::string& title) = 0;
// Called if corrupted data is found in the Service Worker database.
virtual void OnServiceWorkerDatabaseCorrupted(
int64_t service_worker_registration_id) = 0;
virtual ~BackgroundFetchDataManagerObserver() {}
};
} // namespace content
#endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_DATA_MANAGER_OBSERVER_H_