// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_BROWSING_TOPICS_BROWSING_TOPICS_CALCULATOR_H_ #define COMPONENTS_BROWSING_TOPICS_BROWSING_TOPICS_CALCULATOR_H_ #include <map> #include <set> #include "base/containers/queue.h" #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/task/cancelable_task_tracker.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "components/browsing_topics/annotator.h" #include "components/browsing_topics/common/common_types.h" #include "components/browsing_topics/epoch_topics.h" #include "components/history/core/browser/history_types.h" namespace privacy_sandbox { class PrivacySandboxSettings; } // namespace privacy_sandbox namespace history { class HistoryService; } // namespace history namespace content { class BrowsingTopicsSiteDataManager; } // namespace content namespace browsing_topics { // Responsible for doing a one-off browsing topics calculation. It will: // 1) Check the user settings for calculation permissions. // 2) Query the `BrowsingTopicsSiteDataManager` for the contexts where the // Topics API was called on. // 3) Query the `HistoryService` for the hosts of the pages the API was called // on. // 4) Query the `Annotator` with a set of hosts, to get the corresponding // topics. // 5) Derive `EpochTopics` (i.e. the top topics and the their observed-by // contexts), and return it as the final result. class BrowsingTopicsCalculator { … }; } // namespace browsing_topics #endif // COMPONENTS_BROWSING_TOPICS_BROWSING_TOPICS_CALCULATOR_H_