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

Side by Side Diff: chrome/browser/sync/glue/session_change_processor.cc

Issue 10917198: Switch NOTIFICATION_TAB_PARENTED to use WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/glue/session_change_processor.h" 5 #include "chrome/browser/sync/glue/session_change_processor.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 case chrome::NOTIFICATION_BROWSER_OPENED: { 105 case chrome::NOTIFICATION_BROWSER_OPENED: {
106 Browser* browser = content::Source<Browser>(source).ptr(); 106 Browser* browser = content::Source<Browser>(source).ptr();
107 if (!browser || browser->profile() != profile_) { 107 if (!browser || browser->profile() != profile_) {
108 return; 108 return;
109 } 109 }
110 DVLOG(1) << "Received BROWSER_OPENED for profile " << profile_; 110 DVLOG(1) << "Received BROWSER_OPENED for profile " << profile_;
111 break; 111 break;
112 } 112 }
113 113
114 case chrome::NOTIFICATION_TAB_PARENTED: { 114 case chrome::NOTIFICATION_TAB_PARENTED: {
115 SyncedTabDelegate* tab = 115 TabContents* tab_contents = TabContents::FromWebContents(
116 content::Source<TabContents>(source).ptr()->synced_tab_delegate(); 116 content::Source<WebContents>(source).ptr());
117 SyncedTabDelegate* tab = tab_contents->synced_tab_delegate();
117 if (!tab || tab->profile() != profile_) { 118 if (!tab || tab->profile() != profile_) {
118 return; 119 return;
119 } 120 }
120 modified_tabs.push_back(tab); 121 modified_tabs.push_back(tab);
121 DVLOG(1) << "Received TAB_PARENTED for profile " << profile_; 122 DVLOG(1) << "Received TAB_PARENTED for profile " << profile_;
122 break; 123 break;
123 } 124 }
124 125
125 case content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME: { 126 case content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME: {
126 TabContents* tab_contents = TabContents::FromWebContents( 127 TabContents* tab_contents = TabContents::FromWebContents(
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 notification_registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED, 366 notification_registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED,
366 content::Source<Profile>(profile_)); 367 content::Source<Profile>(profile_));
367 } 368 }
368 369
369 void SessionChangeProcessor::StopObserving() { 370 void SessionChangeProcessor::StopObserving() {
370 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
371 notification_registrar_.RemoveAll(); 372 notification_registrar_.RemoveAll();
372 } 373 }
373 374
374 } // namespace browser_sync 375 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_tab_helper.cc ('k') | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698