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

Unified Diff: chrome/browser/ui/webui/chrome_url_data_manager.h

Issue 10196004: Changed ChromeURLDataManager to a ProfileKeyedService and made a Factory for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Made ChromeURLDataManager's destructor virtual Created 8 years, 8 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/chrome_url_data_manager.h
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager.h b/chrome/browser/ui/webui/chrome_url_data_manager.h
index cdaa54e8c654768f762f8c71177d96f2208dce8d..79fb2ae415dbdaf286c16dd84b62b42d0fb84172 100644
--- a/chrome/browser/ui/webui/chrome_url_data_manager.h
+++ b/chrome/browser/ui/webui/chrome_url_data_manager.h
@@ -13,9 +13,11 @@
#include "base/memory/ref_counted.h"
#include "base/message_loop_helpers.h"
#include "base/synchronization/lock.h"
+#include "chrome/browser/profiles/profile_keyed_service.h"
class ChromeURLDataManagerBackend;
class MessageLoop;
+class Profile;
class RefCountedMemory;
namespace base {
@@ -27,7 +29,7 @@ class DictionaryValue;
// with AddDataSource. DataSources must be added on the UI thread (they are also
// deleted on the UI thread). Internally the DataSources are maintained by
// ChromeURLDataManagerBackend, see it for details.
-class ChromeURLDataManager {
+class ChromeURLDataManager : public ProfileKeyedService {
public:
class DataSource;
@@ -142,7 +144,7 @@ class ChromeURLDataManager {
explicit ChromeURLDataManager(
const base::Callback<ChromeURLDataManagerBackend*(void)>& backend);
- ~ChromeURLDataManager();
+ virtual ~ChromeURLDataManager();
// Adds a DataSource to the collection of data sources. This *must* be invoked
// on the UI thread.
@@ -160,6 +162,10 @@ class ChromeURLDataManager {
// for you, but can be invoked to force deletion (such as during shutdown).
static void DeleteDataSources();
+ // Convenience wrapper function to add |source| to |profile|'s
+ // |ChromeURLDataManager|.
+ static void AddDataSource(Profile* profile, DataSource* source);
+
private:
typedef std::vector<const ChromeURLDataManager::DataSource*> DataSources;
« no previous file with comments | « chrome/browser/ui/webui/certificate_viewer_ui.cc ('k') | chrome/browser/ui/webui/chrome_url_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698