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

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 unit tests Created 6 years, 3 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
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index bd2412c5007a0544e3d22528ff547283254238eb..1ab3a552d3f9333101796ea24602d752038942af 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"
@@ -1897,13 +1896,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);
}
}
@@ -2242,13 +2237,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() {
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698