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

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

Issue 882753002: Componentize WebHistoryService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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/chrome/browser/history/web_history_service.h b/components/history/core/browser/web_history_service.h
similarity index 86%
rename from chrome/browser/history/web_history_service.h
rename to components/history/core/browser/web_history_service.h
index e492b0d18ff1964425657e14f0bc7930bfbba2a0..2c0b8b01041e4fa6b558635eee6034c280f0c141 100644
--- a/chrome/browser/history/web_history_service.h
+++ b/components/history/core/browser/web_history_service.h
@@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_
-#define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_
+#ifndef COMPONENTS_HISTORY_CORE_BROWSER_WEB_HISTORY_SERVICE_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_WEB_HISTORY_SERVICE_H_
#include <set>
+#include <string>
+#include <vector>
+#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/profiles/profile.h"
#include "components/history/core/browser/history_types.h"
#include "components/keyed_service/core/keyed_service.h"
@@ -17,9 +19,12 @@ class DictionaryValue;
}
namespace net {
-class URLFetcher;
+class URLRequestContextGetter;
}
+class ProfileOAuth2TokenService;
+class SigninManagerBase;
+
namespace history {
// Provides an API for querying Google servers for a signed-in user's
@@ -67,7 +72,10 @@ class WebHistoryService : public KeyedService {
typedef base::Callback<void(Request*, bool success)> CompletionCallback;
- explicit WebHistoryService(Profile* profile);
+ WebHistoryService(
+ ProfileOAuth2TokenService* token_service,
Roger Tawa OOO till Jul 10th 2015/01/28 13:11:38 Please use OAuth2TokenService instead of ProfileOA
+ SigninManagerBase* signin_manager,
+ const scoped_refptr<net::URLRequestContextGetter>& request_context);
~WebHistoryService() override;
// Searches synced history for visits matching |text_query|. The timeframe to
@@ -141,7 +149,14 @@ class WebHistoryService : public KeyedService {
private:
friend class WebHistoryServiceTest;
- Profile* profile_;
+ // Stores pointer to ProfileOAuth2TokenService and SigninManagerBase keyed
+ // service instance. Normal KeyedService dependencies ensure that they do
droger 2015/01/28 11:03:16 Nit: remove "Normal", it's not clear for me what i
+ // outlive the current service.
+ ProfileOAuth2TokenService* token_service_;
+ SigninManagerBase* signin_manager_;
+
+ // Request context getter to use.
+ scoped_refptr<net::URLRequestContextGetter> request_context_;
// Stores the version_info token received from the server in response to
// a mutation operation (e.g., deleting history). This is used to ensure that
@@ -162,4 +177,4 @@ class WebHistoryService : public KeyedService {
} // namespace history
-#endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_WEB_HISTORY_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698