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

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

Issue 484213002: Refactor HistoryService to not send NOTIFICATION_FAVICON_CHANGED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android compilation Created 6 years, 4 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 714c48ac3a2946571ba34865868414af7fe56679..22b10e4dfe53a3cc484afb9922dd203df5162639 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -24,7 +24,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/favicon/favicon_changed_details.h"
#include "chrome/browser/history/download_row.h"
#include "chrome/browser/history/history_db_task.h"
#include "chrome/browser/history/history_db_task.h"
@@ -1916,13 +1915,9 @@ void HistoryBackend::SetImportedFavicons(
}
}
- if (!favicons_changed.empty()) {
+ if (!favicons_changed.empty() && delegate_) {
// Send the notification about the changed favicon URLs.
- scoped_ptr<FaviconChangedDetails> changed_details(
- new FaviconChangedDetails);
- changed_details->urls.swap(favicons_changed);
- BroadcastNotifications(chrome::NOTIFICATION_FAVICON_CHANGED,
- changed_details.PassAs<HistoryDetails>());
+ delegate_->NotifyFaviconChanged(favicons_changed);
}
}
@@ -2285,13 +2280,10 @@ void HistoryBackend::SendFaviconChangedNotificationForPageAndRedirects(
const GURL& page_url) {
history::RedirectList redirect_list;
GetCachedRecentRedirects(page_url, &redirect_list);
-
- scoped_ptr<FaviconChangedDetails> changed_details(new 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.PassAs<HistoryDetails>());
+ if (!redirect_list.empty() && delegate_) {
+ std::set<GURL> favicons_changed(redirect_list.begin(), redirect_list.end());
+ delegate_->NotifyFaviconChanged(favicons_changed);
+ }
}
void HistoryBackend::Commit() {

Powered by Google App Engine
This is Rietveld 408576698