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 2b170cf519463bdf3a50d1be17952c2aef110a8c..14eb5247c14b054603974993ef2efabd3673e799 100644 |
--- a/components/history/core/browser/web_history_service.h |
+++ b/components/history/core/browser/web_history_service.h |
@@ -25,6 +25,10 @@ namespace net { |
class URLRequestContextGetter; |
} |
+namespace version_info { |
+enum class Channel; |
+} |
+ |
class OAuth2TokenService; |
class SigninManagerBase; |
@@ -55,6 +59,8 @@ class WebHistoryService : public KeyedService { |
virtual void SetPostData(const std::string& post_data) = 0; |
+ virtual void SetUserAgent(const std::string& user_agent) = 0; |
+ |
// Tells the request to begin. |
virtual void Start() = 0; |
@@ -75,6 +81,9 @@ class WebHistoryService : public KeyedService { |
typedef base::Callback<void(bool success)> QueryWebAndAppActivityCallback; |
+ typedef base::Callback<void(bool success)> |
+ QueryOtherFormsOfBrowsingHistoryCallback; |
+ |
typedef base::Callback<void(Request*, bool success)> CompletionCallback; |
WebHistoryService( |
@@ -121,7 +130,10 @@ class WebHistoryService : public KeyedService { |
size_t GetNumberOfPendingAudioHistoryRequests(); |
// Whether there are other forms of browsing history stored on the server. |
- bool HasOtherFormsOfBrowsingHistory() const; |
+ void QueryOtherFormsOfBrowsingHistory( |
+ const version_info::Channel channel, |
+ const std::string& user_agent, |
+ const QueryOtherFormsOfBrowsingHistoryCallback& callback); |
protected: |
// This function is pulled out for testing purposes. Caller takes ownership of |
@@ -166,6 +178,14 @@ class WebHistoryService : public KeyedService { |
WebHistoryService::Request* request, |
bool success); |
+ // Called by |request| when a query for other forms of browsing history has |
+ // completed. Unpacks the response and calls |callback|, which is the original |
+ // callback that was passed to QueryOtherFormsOfBrowsingHistory(). |
+ void QueryOtherFormsOfBrowsingHistoryCompletionCallback( |
+ const WebHistoryService::QueryWebAndAppActivityCallback& callback, |
+ WebHistoryService::Request* request, |
+ bool success); |
+ |
private: |
friend class WebHistoryServiceTest; |
@@ -193,6 +213,10 @@ class WebHistoryService : public KeyedService { |
// profile shutdown. |
std::set<Request*> pending_web_and_app_activity_requests_; |
+ // Pending queries for other forms of browsing history to be canceled if not |
+ // complete by profile shutdown. |
+ std::set<Request*> pending_other_forms_of_browsing_history_requests_; |
+ |
base::WeakPtrFactory<WebHistoryService> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(WebHistoryService); |