Chromium Code Reviews| Index: chrome/browser/ui/app_list/search/history_factory.h |
| diff --git a/chrome/browser/ui/app_list/search/history_factory.h b/chrome/browser/ui/app_list/search/history_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c09fa728917c168008aece37b7a324dc624eff7d |
| --- /dev/null |
| +++ b/chrome/browser/ui/app_list/search/history_factory.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_ |
| +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_ |
| + |
| +#include "base/memory/singleton.h" |
|
tfarina
2013/05/23 22:56:25
could you forward declare this instead?
template
xiyuan
2013/05/24 16:33:02
Done.
|
| +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" |
| + |
| +namespace content { |
| +class BrowserContext; |
| +} |
| + |
| +namespace app_list { |
| + |
| +class History; |
| + |
| +// Singleton that owns all History and associates them with profiles; |
| +class HistoryFactory : public BrowserContextKeyedServiceFactory { |
| + public: |
| + // Returns singleton instance of HistoryFactory. |
| + static HistoryFactory* GetInstance(); |
| + |
| + // Returns History associated with |context|. |
| + static History* GetForBrowserContext(content::BrowserContext* context); |
| + |
| + private: |
| + friend struct DefaultSingletonTraits<HistoryFactory>; |
| + |
| + HistoryFactory(); |
| + virtual ~HistoryFactory(); |
| + |
| + // BrowserContextKeyedServiceFactory overrides: |
| + virtual BrowserContextKeyedService* BuildServiceInstanceFor( |
| + content::BrowserContext* context) const OVERRIDE; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(HistoryFactory); |
| +}; |
| + |
| +} // namespace app_list |
| + |
| +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_FACTORY_H_ |