OLD | NEW |
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // Note, we always associate windows because it's possible a tab became | 233 // Note, we always associate windows because it's possible a tab became |
234 // "interesting" by going to a valid URL, in which case it needs to be added | 234 // "interesting" by going to a valid URL, in which case it needs to be added |
235 // to the window's tab information. | 235 // to the window's tab information. |
236 if (!reassociation_needed) { | 236 if (!reassociation_needed) { |
237 reassociation_needed = | 237 reassociation_needed = |
238 !session_model_associator_->AssociateWindows(false, NULL); | 238 !session_model_associator_->AssociateWindows(false, NULL); |
239 } | 239 } |
240 | 240 |
241 if (reassociation_needed) { | 241 if (reassociation_needed) { |
242 LOG(WARNING) << "Reassociation of local models triggered."; | 242 LOG(WARNING) << "Reassociation of local models triggered."; |
243 SyncError error; | 243 csync::SyncError error; |
244 error = session_model_associator_->DisassociateModels(); | 244 error = session_model_associator_->DisassociateModels(); |
245 error = session_model_associator_->AssociateModels(); | 245 error = session_model_associator_->AssociateModels(); |
246 if (error.IsSet()) { | 246 if (error.IsSet()) { |
247 error_handler()->OnSingleDatatypeUnrecoverableError( | 247 error_handler()->OnSingleDatatypeUnrecoverableError( |
248 error.location(), | 248 error.location(), |
249 error.message()); | 249 error.message()); |
250 } | 250 } |
251 } | 251 } |
252 } | 252 } |
253 | 253 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 notification_registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED, | 366 notification_registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED, |
367 content::Source<Profile>(profile_)); | 367 content::Source<Profile>(profile_)); |
368 } | 368 } |
369 | 369 |
370 void SessionChangeProcessor::StopObserving() { | 370 void SessionChangeProcessor::StopObserving() { |
371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
372 notification_registrar_.RemoveAll(); | 372 notification_registrar_.RemoveAll(); |
373 } | 373 } |
374 | 374 |
375 } // namespace browser_sync | 375 } // namespace browser_sync |
OLD | NEW |