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

Unified Diff: chrome/browser/history/top_sites_service_factory.h

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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: chrome/browser/history/top_sites_service_factory.h
diff --git a/chrome/browser/history/top_sites_service_factory.h b/chrome/browser/history/top_sites_service_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4dd8969ec123112efe3326ae914c68475a0ce5e
--- /dev/null
+++ b/chrome/browser/history/top_sites_service_factory.h
@@ -0,0 +1,40 @@
+// 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 CHROME_BROWSER_HISTORY_TOP_SITES_SERVICE_FACTORY_H_
+#define CHROME_BROWSER_HISTORY_TOP_SITES_SERVICE_FACTORY_H_
+
+#include "base/memory/singleton.h"
sdefresne 2014/12/19 15:11:41 You can remove this include and instead forward-de
Jitu( very slow this week) 2014/12/26 14:04:28 Done.
+#include "chrome/browser/history/top_sites_service.h"
sdefresne 2014/12/19 15:11:41 TopSitesImpl is an implementation details and clie
Jitu( very slow this week) 2014/12/26 14:04:28 Done.
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+// Used for creating and fetching a per-profile instance of the
+// Topsites.
sdefresne 2014/12/19 15:11:42 s/Topsites/TopSites/ (or TopSitesProvider).
Jitu( very slow this week) 2014/12/26 14:04:28 Done.
Jitu( very slow this week) 2014/12/26 14:04:28 Done.
+class TopSitesServiceFactory : public BrowserContextKeyedServiceFactory {
sdefresne 2014/12/19 15:11:42 Since TopSitesProvider is a base::RefCountedThread
Jitu( very slow this week) 2014/12/26 14:04:28 Done.
+ public:
+ // Get the WebHistoryService for |profile|, creating one if needed.
+ static history::TopSitesService* GetForProfile(Profile* profile);
sdefresne 2014/12/19 15:11:41 s/TopSitesService/TopSitesProvider/
+
sdefresne 2014/12/19 15:11:42 You'll need another method GetForProfileIfExists()
Jitu( very slow this week) 2014/12/26 14:04:28 Done.
+ // Get the singleton instance of the factory.
+ static TopSitesServiceFactory* GetInstance();
+
+ protected:
+ // Overridden from BrowserContextKeyedServiceFactory.
+ virtual KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const override;
+
+ // virtual content::BrowserContext* GetBrowserContextToUse(
sdefresne 2014/12/19 15:11:41 Dead-code, remove.
Jitu( very slow this week) 2014/12/26 14:04:28 Done.
+ // content::BrowserContext* context) const override;
+
+ private:
+ friend struct DefaultSingletonTraits<TopSitesServiceFactory>;
+
+ TopSitesServiceFactory();
+ virtual ~TopSitesServiceFactory() override;
+
+ DISALLOW_COPY_AND_ASSIGN(TopSitesServiceFactory);
+};
+
+#endif // CHROME_BROWSER_HISTORY_TOP_SITES_SERVICE_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698