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

Side by Side Diff: chrome/browser/ui/app_list/search/history_factory.h

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_ 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_ 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_
7 7
8 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 8 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
9 9
10 namespace base {
10 template<typename T> struct DefaultSingletonTraits; 11 template<typename T> struct DefaultSingletonTraits;
12 }
11 13
12 namespace content { 14 namespace content {
13 class BrowserContext; 15 class BrowserContext;
14 } 16 }
15 17
16 namespace app_list { 18 namespace app_list {
17 19
18 class History; 20 class History;
19 21
20 // Singleton that owns all History and associates them with profiles; 22 // Singleton that owns all History and associates them with profiles;
21 class HistoryFactory : public BrowserContextKeyedServiceFactory { 23 class HistoryFactory : public BrowserContextKeyedServiceFactory {
22 public: 24 public:
23 // Returns singleton instance of HistoryFactory. 25 // Returns singleton instance of HistoryFactory.
24 static HistoryFactory* GetInstance(); 26 static HistoryFactory* GetInstance();
25 27
26 // Returns History associated with |context|. 28 // Returns History associated with |context|.
27 static History* GetForBrowserContext(content::BrowserContext* context); 29 static History* GetForBrowserContext(content::BrowserContext* context);
28 30
29 private: 31 private:
30 friend struct DefaultSingletonTraits<HistoryFactory>; 32 friend struct base::DefaultSingletonTraits<HistoryFactory>;
31 33
32 HistoryFactory(); 34 HistoryFactory();
33 ~HistoryFactory() override; 35 ~HistoryFactory() override;
34 36
35 // BrowserContextKeyedServiceFactory overrides: 37 // BrowserContextKeyedServiceFactory overrides:
36 KeyedService* BuildServiceInstanceFor( 38 KeyedService* BuildServiceInstanceFor(
37 content::BrowserContext* context) const override; 39 content::BrowserContext* context) const override;
38 40
39 DISALLOW_COPY_AND_ASSIGN(HistoryFactory); 41 DISALLOW_COPY_AND_ASSIGN(HistoryFactory);
40 }; 42 };
41 43
42 } // namespace app_list 44 } // namespace app_list
43 45
44 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_ 46 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698