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

Unified Diff: chrome/browser/sync/glue/session_change_processor.cc

Issue 10079023: Move notifications used only in chrome/ out of content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: six! Created 8 years, 8 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/sync/glue/session_change_processor.cc
diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc
index 6786f2c1c47fd0a1de6a40ada2f3d52884ddb307..8d3fea3bf4a10803808cadadfafe2679c9a23958 100644
--- a/chrome/browser/sync/glue/session_change_processor.cc
+++ b/chrome/browser/sync/glue/session_change_processor.cc
@@ -109,7 +109,7 @@ void SessionChangeProcessor::Observe(
break;
}
- case content::NOTIFICATION_TAB_PARENTED: {
+ case chrome::NOTIFICATION_TAB_PARENTED: {
SyncedTabDelegate* tab =
content::Source<TabContentsWrapper>(source).ptr()->
synced_tab_delegate();
@@ -137,13 +137,20 @@ void SessionChangeProcessor::Observe(
break;
}
- case content::NOTIFICATION_TAB_CLOSED: {
- SyncedTabDelegate* tab = ExtractSyncedTabDelegate(source);
+ case content::NOTIFICATION_WEB_CONTENTS_DESTROYED: {
+ TabContentsWrapper* tab_contents_wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(
+ content::Source<WebContents>(source).ptr());
+ if (!tab_contents_wrapper) {
+ return;
+ }
+ SyncedTabDelegate* tab = tab_contents_wrapper->synced_tab_delegate();
if (!tab || tab->profile() != profile_) {
return;
}
modified_tabs.push_back(tab);
- DVLOG(1) << "Received TAB_CLOSED for profile " << profile_;
+ DVLOG(1) << "Received NOTIFICATION_WEB_CONTENTS_DESTROYED for profile "
+ << profile_;
break;
}
@@ -341,9 +348,10 @@ void SessionChangeProcessor::StartObserving() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!profile_)
return;
- notification_registrar_.Add(this, content::NOTIFICATION_TAB_PARENTED,
+ notification_registrar_.Add(this, chrome::NOTIFICATION_TAB_PARENTED,
content::NotificationService::AllSources());
- notification_registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED,
+ notification_registrar_.Add(this,
+ content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
content::NotificationService::AllSources());
notification_registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED,
content::NotificationService::AllSources());

Powered by Google App Engine
This is Rietveld 408576698