| 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/favicon/favicon_service_factory.h" | 5 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/favicon/chrome_favicon_client_factory.h" | 9 #include "chrome/browser/favicon/chrome_favicon_client_factory.h" |
| 10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "components/favicon/core/browser/favicon_service.h" | 12 #include "components/favicon/core/favicon_service.h" |
| 13 #include "components/history/core/browser/history_service.h" | 13 #include "components/history/core/browser/history_service.h" |
| 14 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 14 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 FaviconService* FaviconServiceFactory::GetForProfile(Profile* profile, | 17 FaviconService* FaviconServiceFactory::GetForProfile(Profile* profile, |
| 18 ServiceAccessType sat) { | 18 ServiceAccessType sat) { |
| 19 if (!profile->IsOffTheRecord()) { | 19 if (!profile->IsOffTheRecord()) { |
| 20 return static_cast<FaviconService*>( | 20 return static_cast<FaviconService*>( |
| 21 GetInstance()->GetServiceForBrowserContext(profile, true)); | 21 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 22 } else if (sat == ServiceAccessType::EXPLICIT_ACCESS) { | 22 } else if (sat == ServiceAccessType::EXPLICIT_ACCESS) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 content::BrowserContext* context) const { | 51 content::BrowserContext* context) const { |
| 52 Profile* profile = Profile::FromBrowserContext(context); | 52 Profile* profile = Profile::FromBrowserContext(context); |
| 53 return new FaviconService(ChromeFaviconClientFactory::GetForProfile(profile), | 53 return new FaviconService(ChromeFaviconClientFactory::GetForProfile(profile), |
| 54 HistoryServiceFactory::GetForProfile( | 54 HistoryServiceFactory::GetForProfile( |
| 55 profile, ServiceAccessType::EXPLICIT_ACCESS)); | 55 profile, ServiceAccessType::EXPLICIT_ACCESS)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool FaviconServiceFactory::ServiceIsNULLWhileTesting() const { | 58 bool FaviconServiceFactory::ServiceIsNULLWhileTesting() const { |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| OLD | NEW |