Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Unified Diff: components/history/core/browser/web_history_service.h

Issue 1829733002: Retrieve the web&app activity enabled state from WebHistoryService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/history/core/browser/web_history_service.h
diff --git a/components/history/core/browser/web_history_service.h b/components/history/core/browser/web_history_service.h
index 523dbf67d81c8ec521b3a4f94b2f03bf8e87dcb5..9962b6f0238f4d07da5e46d35e391cd864d0af27 100644
--- a/components/history/core/browser/web_history_service.h
+++ b/components/history/core/browser/web_history_service.h
@@ -73,6 +73,8 @@ class WebHistoryService : public KeyedService {
typedef base::Callback<void(bool success, bool new_enabled_value)>
AudioWebHistoryCallback;
+ typedef base::Callback<void(bool success)> QueryWebAndAppActivityCallback;
+
typedef base::Callback<void(Request*, bool success)> CompletionCallback;
WebHistoryService(
@@ -111,6 +113,10 @@ class WebHistoryService : public KeyedService {
virtual void SetAudioHistoryEnabled(bool new_enabled_value,
const AudioWebHistoryCallback& callback);
+ // Queries whether web and app activity is enabled on the server.
+ virtual void QueryWebAndAppActivity(
+ const QueryWebAndAppActivityCallback& callback);
+
// Used for tests.
size_t GetNumberOfPendingAudioHistoryRequests();
@@ -152,6 +158,14 @@ class WebHistoryService : public KeyedService {
WebHistoryService::Request* request,
bool success);
+ // Called by |request| when a web and app activity query has completed.
+ // Unpacks the response and calls |callback|, which is the original callback
+ // that was passed to QueryWebAndAppActivity().
+ void QueryWebAndAppActivityCompletionCallback(
+ const WebHistoryService::QueryWebAndAppActivityCallback& callback,
+ WebHistoryService::Request* request,
+ bool success);
+
private:
friend class WebHistoryServiceTest;
@@ -175,6 +189,10 @@ class WebHistoryService : public KeyedService {
// Pending requests to be canceled if not complete by profile shutdown.
std::set<Request*> pending_audio_history_requests_;
+ // Pending web and app activity queries to be canceled if not complete by
+ // profile shutdown.
+ std::set<Request*> pending_web_and_app_activity_requests_;
+
base::WeakPtrFactory<WebHistoryService> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(WebHistoryService);
« no previous file with comments | « components/browsing_data_ui/history_notice_utils.cc ('k') | components/history/core/browser/web_history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698