| 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..3b72d10daae54fabd250b0d5422df970e3589dbe 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,13 @@ void NotificationServiceSessionsRouter::OnNavigationBlocked(
|
| handler_->OnLocalTabModified(tab);
|
| }
|
|
|
| +void NotificationServiceSessionsRouter::OnFaviconChanged(
|
| + HistoryService* history_service,
|
| + const std::set<GURL>& changed_favicons) {
|
| + if (handler_)
|
| + handler_->OnFaviconPageUrlsUpdated(changed_favicons);
|
| +}
|
| +
|
| void NotificationServiceSessionsRouter::StartRoutingTo(
|
| LocalSessionEventHandler* handler) {
|
| DCHECK(!handler_);
|
|
|