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

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: Rebased and fixed unit test fail 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
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 "chrome/browser/history/top_sites.h"
sdefresne 2015/01/22 19:05:05 nit: you don't need this #include, instead you can
sdefresne 2015/01/22 19:05:05 nit: you don't need this #include, instead you can
Jitu( very slow this week) 2015/01/23 11:36:53 Done.
10 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv ice_factory.h"
11
12 template <typename T>
13 struct DefaultSingletonTraits;
14
15 // Used for creating and fetching a per-profile instance of the
16 // TopSites.
17 class TopSitesFactory : public RefcountedBrowserContextKeyedServiceFactory {
18 public:
19 // Get the TopSites service for |profile|, creating one if needed.
20 static scoped_refptr<history::TopSites> GetForProfile(Profile* profile);
21
22 // Get the TopSites service for |profile|, but do not create it if it doesn't
23 // exist.
24 static scoped_refptr<history::TopSites> GetForProfileIfExists(
25 Profile* profile);
26
27 // Get the singleton instance of the factory.
28 static TopSitesFactory* GetInstance();
29
30 static void ShutdownForProfile(Profile* profile);
sdefresne 2015/01/22 19:05:05 This is unused, remove.
Jitu( very slow this week) 2015/01/23 11:36:53 Done.
31
32 private:
33 // Overridden from BrowserContextKeyedServiceFactory.
34 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor(
35 content::BrowserContext* context) const override;
36
sdefresne 2015/01/22 19:05:05 style: remove empty line
Jitu( very slow this week) 2015/01/23 11:36:52 Done.
37 bool ServiceIsNULLWhileTesting() const override;
38
39 friend struct DefaultSingletonTraits<TopSitesFactory>;
sdefresne 2015/01/22 19:05:05 style: friend should go before methods
Bernhard Bauer 2015/01/22 21:23:27 Friend declarations come first in the private sect
Jitu( very slow this week) 2015/01/23 11:36:52 Done.
Jitu( very slow this week) 2015/01/23 11:36:53 Done.
40
41 TopSitesFactory();
42 ~TopSitesFactory() override;
43
44 DISALLOW_COPY_AND_ASSIGN(TopSitesFactory);
45 };
46
47 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698