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

Side by Side Diff: chrome/browser/autocomplete/shortcuts_backend_factory.cc

Issue 773103004: Remove NOTIFICATION_HISTORY_URLS_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to tip 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" 5 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/autocomplete/shortcuts_backend.h" 8 #include "chrome/browser/autocomplete/shortcuts_backend.h"
9 #include "chrome/browser/history/history_service_factory.h"
9 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" 11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 12
12 // static 13 // static
13 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( 14 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile(
14 Profile* profile) { 15 Profile* profile) {
15 return static_cast<ShortcutsBackend*>( 16 return static_cast<ShortcutsBackend*>(
16 GetInstance()->GetServiceForBrowserContext(profile, true).get()); 17 GetInstance()->GetServiceForBrowserContext(profile, true).get());
17 } 18 }
18 19
(...skipping 28 matching lines...) Expand all
47 new ShortcutsBackend(static_cast<Profile*>(profile), true)); 48 new ShortcutsBackend(static_cast<Profile*>(profile), true));
48 if (backend->Init()) 49 if (backend->Init())
49 return backend; 50 return backend;
50 return NULL; 51 return NULL;
51 } 52 }
52 53
53 ShortcutsBackendFactory::ShortcutsBackendFactory() 54 ShortcutsBackendFactory::ShortcutsBackendFactory()
54 : RefcountedBrowserContextKeyedServiceFactory( 55 : RefcountedBrowserContextKeyedServiceFactory(
55 "ShortcutsBackend", 56 "ShortcutsBackend",
56 BrowserContextDependencyManager::GetInstance()) { 57 BrowserContextDependencyManager::GetInstance()) {
58 DependsOn(HistoryServiceFactory::GetInstance());
57 } 59 }
58 60
59 ShortcutsBackendFactory::~ShortcutsBackendFactory() {} 61 ShortcutsBackendFactory::~ShortcutsBackendFactory() {}
60 62
61 scoped_refptr<RefcountedKeyedService> 63 scoped_refptr<RefcountedKeyedService>
62 ShortcutsBackendFactory::BuildServiceInstanceFor( 64 ShortcutsBackendFactory::BuildServiceInstanceFor(
63 content::BrowserContext* profile) const { 65 content::BrowserContext* profile) const {
64 scoped_refptr<ShortcutsBackend> backend( 66 scoped_refptr<ShortcutsBackend> backend(
65 new ShortcutsBackend(static_cast<Profile*>(profile), false)); 67 new ShortcutsBackend(static_cast<Profile*>(profile), false));
66 if (backend->Init()) 68 if (backend->Init())
67 return backend; 69 return backend;
68 return NULL; 70 return NULL;
69 } 71 }
70 72
71 bool ShortcutsBackendFactory::ServiceIsNULLWhileTesting() const { 73 bool ShortcutsBackendFactory::ServiceIsNULLWhileTesting() const {
72 return true; 74 return true;
73 } 75 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/shortcuts_backend.cc ('k') | chrome/browser/autocomplete/shortcuts_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698