Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2109)

Unified Diff: chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.cc

Issue 319623003: [AiS] ImageService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix signed/unsigned conflict. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.cc
diff --git a/chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.cc b/chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9f1a7f686fff75afef8148c696f585123b47519d
--- /dev/null
+++ b/chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.cc
@@ -0,0 +1,36 @@
+// Copyright 2014 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/bitmap_fetcher/bitmap_fetcher_service_factory.h"
+
+#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+/// Factory
+BitmapFetcherService* BitmapFetcherServiceFactory::GetForBrowserContext(
+ content::BrowserContext* profile) {
+ return static_cast<BitmapFetcherService*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+BitmapFetcherServiceFactory* BitmapFetcherServiceFactory::GetInstance() {
+ return Singleton<BitmapFetcherServiceFactory>::get();
+}
+
+BitmapFetcherServiceFactory::BitmapFetcherServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "BitmapFetcherService",
+ BrowserContextDependencyManager::GetInstance()) {
+}
+
+BitmapFetcherServiceFactory::~BitmapFetcherServiceFactory() {
+}
+
+KeyedService* BitmapFetcherServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ Profile* profile = static_cast<Profile*>(context);
+ DCHECK(!profile->IsOffTheRecord());
+ return new BitmapFetcherService(profile);
+}

Powered by Google App Engine
This is Rietveld 408576698