Chromium Code Reviews| 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..63f12a5c6638f711adad7115a51fe357275295b7 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,11 @@ class WebHistoryService : public KeyedService { |
| virtual void SetPostData(const std::string& post_data) = 0; |
| + virtual void SetPostData(const std::string& post_data, |
| + const std::string& mime_type) = 0; |
| + |
| + virtual void SetUserAgent(const std::string& user_agent) = 0; |
| + |
| // Tells the request to begin. |
| virtual void Start() = 0; |
| @@ -75,6 +84,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 +133,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( |
| + version_info::Channel channel, |
| + bool is_tablet, |
|
sdefresne
2016/05/24 08:32:29
You can also use ui::DeviceFormFactor here.
msramek
2016/05/24 12:03:00
Acknowledged. As mentioned in the other comment, i
|
| + const QueryOtherFormsOfBrowsingHistoryCallback& callback); |
| protected: |
| // This function is pulled out for testing purposes. Caller takes ownership of |
| @@ -166,6 +181,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 +216,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); |