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

Unified Diff: chrome/browser/history/history_backend.cc

Issue 15275004: bookmarks: Get rid of the dependency on history_notifications.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more android fixes Created 7 years, 7 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/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 9a63957776a1664d96271552ecfeb479064d8b98..b1edc4684f16cf6bcfb1e0d6bc185000003c5768 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -25,6 +25,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
#include "chrome/browser/bookmarks/bookmark_service.h"
+#include "chrome/browser/favicon/favicon_changed_details.h"
#include "chrome/browser/favicon/imported_favicon_usage.h"
#include "chrome/browser/history/download_row.h"
#include "chrome/browser/history/history_db_task.h"
@@ -2237,13 +2238,14 @@ void HistoryBackend::SetImportedFavicons(
if (!favicons_changed.empty()) {
// Send the notification about the changed favicon URLs.
- FaviconChangeDetails* changed_details = new FaviconChangeDetails;
+ chrome::FaviconChangedDetails* changed_details =
+ new chrome::FaviconChangedDetails;
changed_details->urls.swap(favicons_changed);
- BroadcastNotifications(chrome::NOTIFICATION_FAVICON_CHANGED,
- changed_details);
}
}
+
+
void HistoryBackend::UpdateFaviconMappingsAndFetchImpl(
const GURL* page_url,
const std::vector<GURL>& icon_urls,
@@ -2604,12 +2606,12 @@ void HistoryBackend::SendFaviconChangedNotificationForPageAndRedirects(
history::RedirectList redirect_list;
GetCachedRecentRedirects(page_url, &redirect_list);
- FaviconChangeDetails* changed_details = new FaviconChangeDetails;
+ chrome::FaviconChangedDetails* changed_details =
+ new chrome::FaviconChangedDetails();
for (size_t i = 0; i < redirect_list.size(); ++i)
changed_details->urls.insert(redirect_list[i]);
- BroadcastNotifications(chrome::NOTIFICATION_FAVICON_CHANGED,
- changed_details);
+ SendFaviconChangedNotification(changed_details);
}
void HistoryBackend::Commit() {
@@ -2884,6 +2886,16 @@ void HistoryBackend::ProcessDBTask(
}
}
+void HistoryBackend::SendFaviconChangedNotification(
+ chrome::FaviconChangedDetails* details) {
+ // |delegate_| may be NULL if |this| is in the process of closing (closed by
+ // HistoryService -> HistoryBackend::Closing().
+ if (delegate_)
+ delegate_->SendFaviconChangedNotification(details);
+ else
+ delete details;
+}
+
void HistoryBackend::BroadcastNotifications(
int type,
HistoryDetails* details_deleted) {

Powered by Google App Engine
This is Rietveld 408576698