| 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/history/history_service_factory.h" | 9 #include "chrome/browser/history/history_service_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 : RefcountedBrowserContextKeyedServiceFactory( | 55 : RefcountedBrowserContextKeyedServiceFactory( |
| 56 "ShortcutsBackend", | 56 "ShortcutsBackend", |
| 57 BrowserContextDependencyManager::GetInstance()) { | 57 BrowserContextDependencyManager::GetInstance()) { |
| 58 DependsOn(HistoryServiceFactory::GetInstance()); | 58 DependsOn(HistoryServiceFactory::GetInstance()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 ShortcutsBackendFactory::~ShortcutsBackendFactory() {} | 61 ShortcutsBackendFactory::~ShortcutsBackendFactory() {} |
| 62 | 62 |
| 63 scoped_refptr<RefcountedKeyedService> | 63 scoped_refptr<RefcountedKeyedService> |
| 64 ShortcutsBackendFactory::BuildServiceInstanceFor( | 64 ShortcutsBackendFactory::BuildServiceInstanceFor( |
| 65 content::BrowserContext* profile) const { | 65 content::BrowserContext* context) const { |
| 66 Profile* profile = static_cast<Profile*>(context); |
| 66 scoped_refptr<ShortcutsBackend> backend( | 67 scoped_refptr<ShortcutsBackend> backend( |
| 67 new ShortcutsBackend(static_cast<Profile*>(profile), false)); | 68 new ShortcutsBackend(profile, profile->IsGuestSession())); |
| 68 if (backend->Init()) | 69 if (backend->Init()) |
| 69 return backend; | 70 return backend; |
| 70 return NULL; | 71 return NULL; |
| 71 } | 72 } |
| 72 | 73 |
| 73 bool ShortcutsBackendFactory::ServiceIsNULLWhileTesting() const { | 74 bool ShortcutsBackendFactory::ServiceIsNULLWhileTesting() const { |
| 74 return true; | 75 return true; |
| 75 } | 76 } |
| OLD | NEW |