Index: chrome/browser/extensions/extension_history_api.cc |
diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/extensions/extension_history_api.cc |
index 9ead42236424d59ca9d069b177533b4600ca286a..5bd5733932a91aec49e6412daa393cd09727c6bf 100644 |
--- a/chrome/browser/extensions/extension_history_api.cc |
+++ b/chrome/browser/extensions/extension_history_api.cc |
@@ -64,49 +64,38 @@ void AddVisitNode(const history::VisitRow& row, ListValue* list) { |
} // namespace |
-ExtensionHistoryEventRouter* ExtensionHistoryEventRouter::GetInstance() { |
- return Singleton<ExtensionHistoryEventRouter>::get(); |
-} |
+ExtensionHistoryEventRouter::ExtensionHistoryEventRouter() {} |
+ |
+ExtensionHistoryEventRouter::~ExtensionHistoryEventRouter() {} |
void ExtensionHistoryEventRouter::ObserveProfile(Profile* profile) { |
NotificationSource source = Source<Profile>(profile); |
- if (profiles_.find(source.map_key()) == profiles_.end()) |
- profiles_[source.map_key()] = profile; |
- |
if (registrar_.IsEmpty()) { |
asargent_no_longer_on_chrome
2011/06/23 22:18:38
since you removed the "this is safe to call multip
Yoyo Zhou
2011/06/24 17:21:38
Ok. (I don't know why we went to the effort of mak
asargent_no_longer_on_chrome
2011/06/24 18:56:39
Me neither. =)
|
registrar_.Add(this, |
NotificationType::HISTORY_URL_VISITED, |
- NotificationService::AllSources()); |
+ source); |
registrar_.Add(this, |
NotificationType::HISTORY_URLS_DELETED, |
- NotificationService::AllSources()); |
+ source); |
} |
} |
-ExtensionHistoryEventRouter::ExtensionHistoryEventRouter() {} |
- |
-ExtensionHistoryEventRouter::~ExtensionHistoryEventRouter() {} |
- |
void ExtensionHistoryEventRouter::Observe(NotificationType type, |
const NotificationSource& source, |
const NotificationDetails& details) { |
- ProfileMap::iterator it = profiles_.find(source.map_key()); |
- if (it != profiles_.end()) { |
- Profile* profile = it->second; |
- switch (type.value) { |
- case NotificationType::HISTORY_URL_VISITED: |
- HistoryUrlVisited( |
- profile, |
- Details<const history::URLVisitedDetails>(details).ptr()); |
- break; |
- case NotificationType::HISTORY_URLS_DELETED: |
- HistoryUrlsRemoved( |
- profile, |
- Details<const history::URLsDeletedDetails>(details).ptr()); |
- break; |
- default: |
- NOTREACHED(); |
- } |
+ switch (type.value) { |
+ case NotificationType::HISTORY_URL_VISITED: |
+ HistoryUrlVisited( |
+ Source<Profile>(source).ptr(), |
+ Details<const history::URLVisitedDetails>(details).ptr()); |
+ break; |
+ case NotificationType::HISTORY_URLS_DELETED: |
+ HistoryUrlsRemoved( |
+ Source<Profile>(source).ptr(), |
+ Details<const history::URLsDeletedDetails>(details).ptr()); |
+ break; |
+ default: |
+ NOTREACHED(); |
} |
} |