| Index: chrome/browser/favicon/chrome_fallback_icon_client_factory.cc
|
| diff --git a/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc b/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..76b7d55c5bfedd927a5f7a67262ed3b46ba2ceb5
|
| --- /dev/null
|
| +++ b/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/favicon/chrome_fallback_icon_client_factory.h"
|
| +
|
| +#include "chrome/browser/profiles/incognito_helpers.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "components/keyed_service/content/browser_context_dependency_manager.h"
|
| +
|
| +ChromeFallbackIconClientFactory::ChromeFallbackIconClientFactory()
|
| + : BrowserContextKeyedServiceFactory(
|
| + "ChromeFallbackIconClient",
|
| + BrowserContextDependencyManager::GetInstance()) {
|
| +}
|
| +
|
| +ChromeFallbackIconClientFactory::~ChromeFallbackIconClientFactory() {
|
| +}
|
| +
|
| +// static
|
| +FallbackIconClient* ChromeFallbackIconClientFactory::GetForProfile(
|
| + Profile* profile) {
|
| + return static_cast<FallbackIconClient*>(
|
| + GetInstance()->GetServiceForBrowserContext(profile, true));
|
| +}
|
| +
|
| +// static
|
| +ChromeFallbackIconClientFactory*
|
| +ChromeFallbackIconClientFactory::GetInstance() {
|
| + return Singleton<ChromeFallbackIconClientFactory>::get();
|
| +}
|
| +
|
| +KeyedService* ChromeFallbackIconClientFactory::BuildServiceInstanceFor(
|
| + content::BrowserContext* context) const {
|
| + ChromeFallbackIconClient* client =
|
| + new ChromeFallbackIconClient(Profile::FromBrowserContext(context));
|
| + return client;
|
| +}
|
| +
|
| +content::BrowserContext*
|
| +ChromeFallbackIconClientFactory::GetBrowserContextToUse(
|
| + content::BrowserContext* context) const {
|
| + return chrome::GetBrowserContextRedirectedInIncognito(context);
|
| +}
|
|
|