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

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

Issue 1809603005: Create a --disable-top-sites flag for use by telemetry tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move flag check to factory Created 4 years, 5 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 | « no previous file | 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
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 <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv ice_factory.h" 12 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv ice_factory.h"
13 13
14 class Profile; 14 class Profile;
15 15
16 namespace base { 16 namespace base {
17 template <typename T> 17 template <typename T>
18 struct DefaultSingletonTraits; 18 struct DefaultSingletonTraits;
19 } 19 }
20 20
21 namespace history { 21 namespace history {
22 struct PrepopulatedPage; 22 struct PrepopulatedPage;
23 class TopSites; 23 class TopSites;
24 } 24 }
25 25
26 class Profile; 26 class Profile;
27 27
28 // Used for creating and fetching a per-profile instance of the 28 // Used for creating and fetching a per-profile instance of the TopSites.
29 // TopSites.
30 class TopSitesFactory : public RefcountedBrowserContextKeyedServiceFactory { 29 class TopSitesFactory : public RefcountedBrowserContextKeyedServiceFactory {
31 public: 30 public:
32 // Get the TopSites service for |profile|, creating one if needed. 31 // Get the TopSites service for |profile|, creating one if needed.
33 static scoped_refptr<history::TopSites> GetForProfile(Profile* profile); 32 static scoped_refptr<history::TopSites> GetForProfile(Profile* profile);
34 33
35 // Get the singleton instance of the factory. 34 // Get the singleton instance of the factory.
36 static TopSitesFactory* GetInstance(); 35 static TopSitesFactory* GetInstance();
37 36
38 // Creates a TopSites service for |context| with |prepopulated_page_list|. 37 // Creates a TopSites service for |context| with |prepopulated_page_list|.
39 // Public for testing. 38 // Public for testing.
(...skipping 11 matching lines...) Expand all
51 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor( 50 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor(
52 content::BrowserContext* context) const override; 51 content::BrowserContext* context) const override;
53 void RegisterProfilePrefs( 52 void RegisterProfilePrefs(
54 user_prefs::PrefRegistrySyncable* registry) override; 53 user_prefs::PrefRegistrySyncable* registry) override;
55 bool ServiceIsNULLWhileTesting() const override; 54 bool ServiceIsNULLWhileTesting() const override;
56 55
57 DISALLOW_COPY_AND_ASSIGN(TopSitesFactory); 56 DISALLOW_COPY_AND_ASSIGN(TopSitesFactory);
58 }; 57 };
59 58
60 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ 59 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/top_sites_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698