| Index: ios/chrome/browser/favicon/large_icon_cache_factory.mm
|
| diff --git a/ios/chrome/browser/favicon/large_icon_cache_factory.mm b/ios/chrome/browser/favicon/large_icon_cache_factory.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e6112f72dc7bca61558c4db555f491678c99f8d4
|
| --- /dev/null
|
| +++ b/ios/chrome/browser/favicon/large_icon_cache_factory.mm
|
| @@ -0,0 +1,42 @@
|
| +// 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 "ios/chrome/browser/favicon/large_icon_cache_factory.h"
|
| +
|
| +#include "base/memory/singleton.h"
|
| +#include "components/keyed_service/ios/browser_state_dependency_manager.h"
|
| +#include "ios/chrome/browser/browser_state/browser_state_otr_helper.h"
|
| +#include "ios/chrome/browser/favicon/large_icon_cache.h"
|
| +#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
|
| +
|
| +// static
|
| +LargeIconCache* LargeIconCacheFactory::GetForBrowserState(
|
| + ios::ChromeBrowserState* browser_state) {
|
| + return static_cast<LargeIconCache*>(
|
| + GetInstance()->GetServiceForBrowserState(browser_state, true));
|
| +}
|
| +
|
| +// static
|
| +LargeIconCacheFactory* LargeIconCacheFactory::GetInstance() {
|
| + return base::Singleton<LargeIconCacheFactory>::get();
|
| +}
|
| +
|
| +LargeIconCacheFactory::LargeIconCacheFactory()
|
| + : BrowserStateKeyedServiceFactory(
|
| + "LargeIconCache",
|
| + BrowserStateDependencyManager::GetInstance()) {}
|
| +
|
| +LargeIconCacheFactory::~LargeIconCacheFactory() {}
|
| +
|
| +scoped_ptr<KeyedService> LargeIconCacheFactory::BuildServiceInstanceFor(
|
| + web::BrowserState* context) const {
|
| + ios::ChromeBrowserState* browser_state =
|
| + ios::ChromeBrowserState::FromBrowserState(context);
|
| + return make_scoped_ptr(new LargeIconCache(browser_state));
|
| +}
|
| +
|
| +web::BrowserState* LargeIconCacheFactory::GetBrowserStateToUse(
|
| + web::BrowserState* context) const {
|
| + return GetBrowserStateOwnInstanceInIncognito(context);
|
| +}
|
|
|