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

Side by Side Diff: chrome/browser/sync/sessions2/notification_service_sessions_router.cc

Issue 132263003: sync: fix tiny bug with NotificationServiceSessionsRouter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sessions2/notification_service_sessions_router.h" 5 #include "chrome/browser/sync/sessions2/notification_service_sessions_router.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/extensions/tab_helper.h" 9 #include "chrome/browser/extensions/tab_helper.h"
10 #include "chrome/browser/favicon/favicon_changed_details.h" 10 #include "chrome/browser/favicon/favicon_changed_details.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if (!flare_.is_null()) { 128 if (!flare_.is_null()) {
129 flare_.Run(syncer::SESSIONS); 129 flare_.Run(syncer::SESSIONS);
130 flare_.Reset(); 130 flare_.Reset();
131 } 131 }
132 } 132 }
133 133
134 void NotificationServiceSessionsRouter::OnNavigationBlocked( 134 void NotificationServiceSessionsRouter::OnNavigationBlocked(
135 content::WebContents* web_contents) { 135 content::WebContents* web_contents) {
136 SyncedTabDelegate* tab = 136 SyncedTabDelegate* tab =
137 SyncedTabDelegate::ImplFromWebContents(web_contents); 137 SyncedTabDelegate::ImplFromWebContents(web_contents);
138 if (!tab) 138 if (!tab || !handler_)
139 return; 139 return;
140 140
141 DCHECK(tab->profile() == profile_); 141 DCHECK(tab->profile() == profile_);
142 handler_->OnLocalTabModified(tab); 142 handler_->OnLocalTabModified(tab);
143 } 143 }
144 144
145 void NotificationServiceSessionsRouter::StartRoutingTo( 145 void NotificationServiceSessionsRouter::StartRoutingTo(
146 LocalSessionEventHandler* handler) { 146 LocalSessionEventHandler* handler) {
147 DCHECK(!handler_); 147 DCHECK(!handler_);
148 handler_ = handler; 148 handler_ = handler;
149 } 149 }
150 150
151 void NotificationServiceSessionsRouter::Stop() { 151 void NotificationServiceSessionsRouter::Stop() {
152 weak_ptr_factory_.InvalidateWeakPtrs(); 152 weak_ptr_factory_.InvalidateWeakPtrs();
153 registrar_.RemoveAll(); 153 registrar_.RemoveAll();
154 handler_ = NULL; 154 handler_ = NULL;
155 } 155 }
156 156
157 } // namespace browser_sync 157 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698