OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sessions/sessions_sync_manager.h" | 5 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" |
6 | 6 |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | 10 #include "chrome/browser/sync/glue/synced_tab_delegate.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 syncer::SyncChangeList changes; | 388 syncer::SyncChangeList changes; |
389 // Associate tabs first so the synced session tracker is aware of them. | 389 // Associate tabs first so the synced session tracker is aware of them. |
390 AssociateTab(modified_tab, &changes); | 390 AssociateTab(modified_tab, &changes); |
391 // Note, we always associate windows because it's possible a tab became | 391 // Note, we always associate windows because it's possible a tab became |
392 // "interesting" by going to a valid URL, in which case it needs to be added | 392 // "interesting" by going to a valid URL, in which case it needs to be added |
393 // to the window's tab information. | 393 // to the window's tab information. |
394 AssociateWindows(DONT_RELOAD_TABS, syncer::SyncDataList(), &changes); | 394 AssociateWindows(DONT_RELOAD_TABS, syncer::SyncDataList(), &changes); |
395 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); | 395 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); |
396 } | 396 } |
397 | 397 |
398 void SessionsSyncManager::OnFaviconPageUrlsUpdated( | 398 void SessionsSyncManager::OnFaviconsChanged( |
399 const std::set<GURL>& updated_favicon_page_urls) { | 399 const std::vector<GURL>& page_urls, |
400 const std::vector<GURL>& icon_urls) { | |
Roger McFarlane (Chromium)
2015/05/13 16:07:05
nit: comment out icon_urls, as it's not used in th
pkotwicz
2015/05/13 17:26:49
Done.
| |
400 // TODO(zea): consider a separate container for tabs with outstanding favicon | 401 // TODO(zea): consider a separate container for tabs with outstanding favicon |
401 // loads so we don't have to iterate through all tabs comparing urls. | 402 // loads so we don't have to iterate through all tabs comparing urls. |
402 for (std::set<GURL>::const_iterator i = updated_favicon_page_urls.begin(); | 403 for (const GURL& page_url : page_urls) { |
403 i != updated_favicon_page_urls.end(); ++i) { | |
404 for (TabLinksMap::iterator tab_iter = local_tab_map_.begin(); | 404 for (TabLinksMap::iterator tab_iter = local_tab_map_.begin(); |
405 tab_iter != local_tab_map_.end(); | 405 tab_iter != local_tab_map_.end(); |
406 ++tab_iter) { | 406 ++tab_iter) { |
407 if (tab_iter->second->url() == *i) | 407 if (tab_iter->second->url() == page_url) |
408 favicon_cache_.OnPageFaviconUpdated(*i); | 408 favicon_cache_.OnPageFaviconUpdated(page_url); |
409 } | 409 } |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 void SessionsSyncManager::StopSyncing(syncer::ModelType type) { | 413 void SessionsSyncManager::StopSyncing(syncer::ModelType type) { |
414 local_event_router_->Stop(); | 414 local_event_router_->Stop(); |
415 sync_processor_.reset(NULL); | 415 sync_processor_.reset(NULL); |
416 error_handler_.reset(); | 416 error_handler_.reset(); |
417 session_tracker_.Clear(); | 417 session_tracker_.Clear(); |
418 local_tab_map_.clear(); | 418 local_tab_map_.clear(); |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1062 << " with age " << session_age_in_days << ", deleting."; | 1062 << " with age " << session_age_in_days << ", deleting."; |
1063 DeleteForeignSessionInternal(session_tag, &changes); | 1063 DeleteForeignSessionInternal(session_tag, &changes); |
1064 } | 1064 } |
1065 } | 1065 } |
1066 | 1066 |
1067 if (!changes.empty()) | 1067 if (!changes.empty()) |
1068 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); | 1068 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); |
1069 } | 1069 } |
1070 | 1070 |
1071 }; // namespace browser_sync | 1071 }; // namespace browser_sync |
OLD | NEW |