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

Side by Side Diff: chrome/browser/history/top_sites_factory.h

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments Created 5 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/history/top_sites.cc ('k') | chrome/browser/history/top_sites_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_
6 #define CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv ice_factory.h"
10
11 class Profile;
12
13 namespace history {
14 class TopSites;
15 }
16
17 template <typename T>
18 struct DefaultSingletonTraits;
19
20 // Used for creating and fetching a per-profile instance of the
21 // TopSites.
22 class TopSitesFactory : public RefcountedBrowserContextKeyedServiceFactory {
23 public:
24 // Get the TopSites service for |profile|, creating one if needed.
25 static scoped_refptr<history::TopSites> GetForProfile(Profile* profile);
26
27 // Get the TopSites service for |profile|, but do not create it if it doesn't
28 // exist.
29 static scoped_refptr<history::TopSites> GetForProfileIfExists(
30 Profile* profile);
31
32 // Get the singleton instance of the factory.
33 static TopSitesFactory* GetInstance();
34
35 private:
36 friend struct DefaultSingletonTraits<TopSitesFactory>;
37 // Overridden from BrowserContextKeyedServiceFactory.
38 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor(
39 content::BrowserContext* context) const override;
40 bool ServiceIsNULLWhileTesting() const override;
41
42 TopSitesFactory();
Bernhard Bauer 2015/01/23 14:34:06 Constructors and descructors should come before ot
Jitu( very slow this week) 2015/01/24 11:48:23 Done.
43 ~TopSitesFactory() override;
44
45 DISALLOW_COPY_AND_ASSIGN(TopSitesFactory);
46 };
47
48 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites.cc ('k') | chrome/browser/history/top_sites_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698