OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_SERVICE_FACTORY_H_ | |
6 #define CHROME_BROWSER_HISTORY_TOP_SITES_SERVICE_FACTORY_H_ | |
7 | |
8 #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.
| |
9 #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.
| |
10 #include "chrome/browser/profiles/profile.h" | |
11 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | |
12 | |
13 // Used for creating and fetching a per-profile instance of the | |
14 // 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.
| |
15 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.
| |
16 public: | |
17 // Get the WebHistoryService for |profile|, creating one if needed. | |
18 static history::TopSitesService* GetForProfile(Profile* profile); | |
sdefresne
2014/12/19 15:11:41
s/TopSitesService/TopSitesProvider/
| |
19 | |
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.
| |
20 // Get the singleton instance of the factory. | |
21 static TopSitesServiceFactory* GetInstance(); | |
22 | |
23 protected: | |
24 // Overridden from BrowserContextKeyedServiceFactory. | |
25 virtual KeyedService* BuildServiceInstanceFor( | |
26 content::BrowserContext* context) const override; | |
27 | |
28 // 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.
| |
29 // content::BrowserContext* context) const override; | |
30 | |
31 private: | |
32 friend struct DefaultSingletonTraits<TopSitesServiceFactory>; | |
33 | |
34 TopSitesServiceFactory(); | |
35 virtual ~TopSitesServiceFactory() override; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(TopSitesServiceFactory); | |
38 }; | |
39 | |
40 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_SERVICE_FACTORY_H_ | |
OLD | NEW |