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

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

Issue 200493006: Move the ShortcutsBackend from history to autocomplete so that it can fully (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_SHORTCUTS_BACKEND_FACTORY_H_
6 #define CHROME_BROWSER_HISTORY_SHORTCUTS_BACKEND_FACTORY_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/singleton.h"
10 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv ice_factory.h"
11
12 class Profile;
13
14 namespace history {
15 class ShortcutsBackend;
16 } // namespace history
17
18 // Singleton that owns all instances of ShortcutsBackend and associates them
19 // with Profiles.
20 class ShortcutsBackendFactory
21 : public RefcountedBrowserContextKeyedServiceFactory {
22 public:
23 static scoped_refptr<history::ShortcutsBackend> GetForProfile(
24 Profile* profile);
25
26 static scoped_refptr<history::ShortcutsBackend> GetForProfileIfExists(
27 Profile* profile);
28
29 static ShortcutsBackendFactory* GetInstance();
30
31 // Creates and returns a backend for testing purposes.
32 static scoped_refptr<RefcountedBrowserContextKeyedService>
33 BuildProfileForTesting(content::BrowserContext* profile);
34
35 // Creates and returns a backend but without creating its persistent database
36 // for testing purposes.
37 static scoped_refptr<RefcountedBrowserContextKeyedService>
38 BuildProfileNoDatabaseForTesting(content::BrowserContext* profile);
39
40 private:
41 friend struct DefaultSingletonTraits<ShortcutsBackendFactory>;
42
43 ShortcutsBackendFactory();
44 virtual ~ShortcutsBackendFactory();
45
46 // BrowserContextKeyedServiceFactory:
47 virtual scoped_refptr<RefcountedBrowserContextKeyedService>
48 BuildServiceInstanceFor(content::BrowserContext* profile) const OVERRIDE;
49 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
50 };
51
52 #endif // CHROME_BROWSER_HISTORY_SHORTCUTS_BACKEND_FACTORY_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/shortcuts_backend.cc ('k') | chrome/browser/history/shortcuts_backend_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698