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

Unified Diff: ios/chrome/browser/suggestions/suggestions_service_factory.h

Issue 790773003: Upstream iOS SuggestionsServiceFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@436897.1
Patch Set: Rebase Created 6 years 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: ios/chrome/browser/suggestions/suggestions_service_factory.h
diff --git a/ios/chrome/browser/suggestions/suggestions_service_factory.h b/ios/chrome/browser/suggestions/suggestions_service_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f63199447a17b103c60ea409b9dbf91f2fe7441
--- /dev/null
+++ b/ios/chrome/browser/suggestions/suggestions_service_factory.h
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_
+#define IOS_CHROME_BROWSER_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_
+
+#include "base/macros.h"
+#include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
+
+template <typename T>
+struct DefaultSingletonTraits;
+
+namespace web {
+class BrowserState;
+}
+
+namespace suggestions {
+
+class SuggestionsService;
+
+// Singleton that owns all SuggestionsServices and associates them with
+// web::BrowserState.
+class SuggestionsServiceFactory : public BrowserStateKeyedServiceFactory {
+ public:
+ static SuggestionsServiceFactory* GetInstance();
+
+ // Returns the SuggestionsService for |browser_state|.
+ static SuggestionsService* GetForBrowserState(
+ web::BrowserState* browser_state);
+
+ private:
+ friend struct DefaultSingletonTraits<SuggestionsServiceFactory>;
+
+ SuggestionsServiceFactory();
+ ~SuggestionsServiceFactory();
+
+ // BrowserStateKeyedServiceFactory:
+ KeyedService* BuildServiceInstanceFor(
+ web::BrowserState* browser_state) const override;
+ void RegisterProfilePrefs(
+ user_prefs::PrefRegistrySyncable* registry) override;
+
+ DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceFactory);
+};
+
+} // namespace suggestions
+
+#endif // IOS_CHROME_BROWSER_SUGGESTIONS_SUGGESTIONS_SERVICE_FACTORY_H_
« no previous file with comments | « ios/chrome/browser/suggestions/image_fetcher_impl.mm ('k') | ios/chrome/browser/suggestions/suggestions_service_factory.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698