OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ |
6 #define CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv
ice_factory.h" | 9 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv
ice_factory.h" |
10 | 10 |
11 class Profile; | 11 class Profile; |
12 | 12 |
13 namespace history { | 13 namespace history { |
14 class TopSites; | 14 class TopSites; |
15 } | 15 } |
16 | 16 |
17 template <typename T> | 17 template <typename T> |
18 struct DefaultSingletonTraits; | 18 struct DefaultSingletonTraits; |
19 | 19 |
| 20 namespace history { |
| 21 class TopSites; |
| 22 } |
| 23 |
| 24 class Profile; |
| 25 |
20 // Used for creating and fetching a per-profile instance of the | 26 // Used for creating and fetching a per-profile instance of the |
21 // TopSites. | 27 // TopSites. |
22 class TopSitesFactory : public RefcountedBrowserContextKeyedServiceFactory { | 28 class TopSitesFactory : public RefcountedBrowserContextKeyedServiceFactory { |
23 public: | 29 public: |
24 // Get the TopSites service for |profile|, creating one if needed. | 30 // Get the TopSites service for |profile|, creating one if needed. |
25 static scoped_refptr<history::TopSites> GetForProfile(Profile* profile); | 31 static scoped_refptr<history::TopSites> GetForProfile(Profile* profile); |
26 | 32 |
27 // Get the TopSites service for |profile|, but do not create it if it doesn't | 33 // Get the TopSites service for |profile|, but do not create it if it doesn't |
28 // exist. | 34 // exist. |
29 static scoped_refptr<history::TopSites> GetForProfileIfExists( | 35 static scoped_refptr<history::TopSites> GetForProfileIfExists( |
(...skipping 10 matching lines...) Expand all Loading... |
40 | 46 |
41 // Overridden from BrowserContextKeyedServiceFactory. | 47 // Overridden from BrowserContextKeyedServiceFactory. |
42 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor( | 48 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor( |
43 content::BrowserContext* context) const override; | 49 content::BrowserContext* context) const override; |
44 bool ServiceIsNULLWhileTesting() const override; | 50 bool ServiceIsNULLWhileTesting() const override; |
45 | 51 |
46 DISALLOW_COPY_AND_ASSIGN(TopSitesFactory); | 52 DISALLOW_COPY_AND_ASSIGN(TopSitesFactory); |
47 }; | 53 }; |
48 | 54 |
49 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ | 55 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ |
OLD | NEW |