Index: components/suggestions/suggestions_service.h |
diff --git a/chrome/browser/search/suggestions/suggestions_service.h b/components/suggestions/suggestions_service.h |
similarity index 88% |
rename from chrome/browser/search/suggestions/suggestions_service.h |
rename to components/suggestions/suggestions_service.h |
index 635ae5d1cbac5a625f830f86398b4527564593cf..5d92ee0687261ad61dfd878167b6b5ae48040fb6 100644 |
--- a/chrome/browser/search/suggestions/suggestions_service.h |
+++ b/components/suggestions/suggestions_service.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
-#define CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
+#ifndef COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
+#define COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
#include <string> |
#include <vector> |
@@ -14,14 +14,19 @@ |
#include "base/gtest_prod_util.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
+#include "base/threading/thread_checker.h" |
#include "base/time/time.h" |
-#include "chrome/browser/search/suggestions/image_manager.h" |
-#include "chrome/browser/search/suggestions/proto/suggestions.pb.h" |
#include "components/keyed_service/core/keyed_service.h" |
+#include "components/suggestions/image_manager.h" |
+#include "components/suggestions/proto/suggestions.pb.h" |
#include "net/url_request/url_fetcher_delegate.h" |
#include "ui/gfx/image/image_skia.h" |
#include "url/gurl.h" |
+namespace base { |
+class SingleThreadTaskRunner; |
+} // namespace base |
+ |
namespace net { |
class URLRequestContextGetter; |
} // namespace net |
@@ -49,10 +54,12 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate { |
public: |
typedef base::Callback<void(const SuggestionsProfile&)> ResponseCallback; |
- SuggestionsService(net::URLRequestContextGetter* url_request_context, |
- scoped_ptr<SuggestionsStore> suggestions_store, |
- scoped_ptr<ImageManager> thumbnail_manager, |
- scoped_ptr<BlacklistStore> blacklist_store); |
+ SuggestionsService( |
+ net::URLRequestContextGetter* url_request_context, |
+ scoped_ptr<SuggestionsStore> suggestions_store, |
+ scoped_ptr<ImageManager> thumbnail_manager, |
+ scoped_ptr<BlacklistStore> blacklist_store, |
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
virtual ~SuggestionsService(); |
// Whether this service is enabled. |
@@ -135,6 +142,11 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate { |
int blacklist_delay() const { return blacklist_delay_sec_; } |
void set_blacklist_delay(int delay) { blacklist_delay_sec_ = delay; } |
+ base::ThreadChecker thread_checker_; |
+ |
+ // Task runner on which callback tasks are posted. |
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
+ |
// The cache for the suggestions. |
scoped_ptr<SuggestionsStore> suggestions_store_; |
@@ -182,4 +194,4 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate { |
} // namespace suggestions |
-#endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
+#endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |