OLD | NEW |
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/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/common/pref_names.h" | |
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
12 | 11 |
13 // static | 12 // static |
14 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( | 13 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( |
15 Profile* profile) { | 14 Profile* profile) { |
16 return static_cast<ShortcutsBackend*>( | 15 return static_cast<ShortcutsBackend*>( |
17 GetInstance()->GetServiceForBrowserContext(profile, true).get()); | 16 GetInstance()->GetServiceForBrowserContext(profile, true).get()); |
18 } | 17 } |
19 | 18 |
20 // static | 19 // static |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 scoped_refptr<ShortcutsBackend> backend( | 64 scoped_refptr<ShortcutsBackend> backend( |
66 new ShortcutsBackend(static_cast<Profile*>(profile), false)); | 65 new ShortcutsBackend(static_cast<Profile*>(profile), false)); |
67 if (backend->Init()) | 66 if (backend->Init()) |
68 return backend; | 67 return backend; |
69 return NULL; | 68 return NULL; |
70 } | 69 } |
71 | 70 |
72 bool ShortcutsBackendFactory::ServiceIsNULLWhileTesting() const { | 71 bool ShortcutsBackendFactory::ServiceIsNULLWhileTesting() const { |
73 return true; | 72 return true; |
74 } | 73 } |
OLD | NEW |