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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h

Issue 7248038: Profiles: Make NTPResourceCache a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add files Created 9 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/ui/webui/ntp/ntp_resource_cache_factory.h
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..0542b9919c88686d979d0d89266dba7338e36552
--- /dev/null
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2011 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.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_FACTORY_H_
+#define CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_FACTORY_H_
+#pragma once
+
+#include "base/memory/singleton.h"
+#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+
+class NTPResourceCache;
+
+// Singleton that owns all NTPResourceCaches and associates them with
+// Profiles. Listens for the Profile's destruction notification and cleans up
+// the associated ThemeService.
+class NTPResourceCacheFactory : public ProfileKeyedServiceFactory {
+ public:
+ static NTPResourceCache* GetForProfile(Profile* profile);
+
+ static NTPResourceCacheFactory* GetInstance();
+
+ private:
+ friend struct DefaultSingletonTraits<NTPResourceCacheFactory>;
+
+ NTPResourceCacheFactory();
+ virtual ~NTPResourceCacheFactory();
+
+ // ProfileKeyedServiceFactory:
+ virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) const;
+ virtual bool ServiceRedirectedInIncognito();
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_FACTORY_H_
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698