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

Unified Diff: chrome/browser/sync/sessions/notification_service_sessions_router.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/sync/sessions/notification_service_sessions_router.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sessions/notification_service_sessions_router.cc
diff --git a/chrome/browser/sync/sessions/notification_service_sessions_router.cc b/chrome/browser/sync/sessions/notification_service_sessions_router.cc
index 35f58c08d60ecc5bba9445c0a9df551b7784c1d7..9eb943fae16b01141ce7db4fbf73d5ce21a58634 100644
--- a/chrome/browser/sync/sessions/notification_service_sessions_router.cc
+++ b/chrome/browser/sync/sessions/notification_service_sessions_router.cc
@@ -7,7 +7,8 @@
#include "base/logging.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/tab_helper.h"
-#include "chrome/browser/favicon/favicon_changed_details.h"
+#include "chrome/browser/history/history_service.h"
+#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/glue/sync_start_util.h"
#include "chrome/browser/sync/glue/synced_tab_delegate.h"
@@ -53,8 +54,13 @@ NotificationServiceSessionsRouter::NotificationServiceSessionsRouter(
registrar_.Add(this,
content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
content::NotificationService::AllBrowserContextsAndSources());
- registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED,
- content::Source<Profile>(profile_));
+ HistoryService* history_service =
+ HistoryServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS);
+ if (history_service) {
+ favicon_changed_subscription_ = history_service->AddFaviconChangedCallback(
+ base::Bind(&NotificationServiceSessionsRouter::OnFaviconChanged,
+ base::Unretained(this)));
+ }
#if defined(ENABLE_MANAGED_USERS)
if (profile_->IsSupervised()) {
SupervisedUserService* supervised_user_service =
@@ -73,12 +79,6 @@ void NotificationServiceSessionsRouter::Observe(
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_FAVICON_CHANGED: {
- content::Details<FaviconChangedDetails> favicon_details(details);
- if (handler_)
- handler_->OnFaviconPageUrlsUpdated(favicon_details->urls);
- return;
- }
// Source<WebContents>.
case chrome::NOTIFICATION_TAB_PARENTED:
case content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME:
@@ -149,6 +149,12 @@ void NotificationServiceSessionsRouter::OnNavigationBlocked(
handler_->OnLocalTabModified(tab);
}
+void NotificationServiceSessionsRouter::OnFaviconChanged(
+ const std::set<GURL>& changed_favicons) {
+ if (handler_)
+ handler_->OnFaviconPageUrlsUpdated(changed_favicons);
+}
+
void NotificationServiceSessionsRouter::StartRoutingTo(
LocalSessionEventHandler* handler) {
DCHECK(!handler_);
« no previous file with comments | « chrome/browser/sync/sessions/notification_service_sessions_router.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698