| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_model_associator.h" | 5 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 current_index - kMaxSyncNavigationCount); | 475 current_index - kMaxSyncNavigationCount); |
| 476 const int max_index = std::min(current_index + kMaxSyncNavigationCount, | 476 const int max_index = std::min(current_index + kMaxSyncNavigationCount, |
| 477 tab_delegate.GetEntryCount()); | 477 tab_delegate.GetEntryCount()); |
| 478 session_tab->navigations.clear(); | 478 session_tab->navigations.clear(); |
| 479 for (int i = min_index; i < max_index; ++i) { | 479 for (int i = min_index; i < max_index; ++i) { |
| 480 const NavigationEntry* entry = (i == pending_index) ? | 480 const NavigationEntry* entry = (i == pending_index) ? |
| 481 tab_delegate.GetPendingEntry() : tab_delegate.GetEntryAtIndex(i); | 481 tab_delegate.GetPendingEntry() : tab_delegate.GetEntryAtIndex(i); |
| 482 DCHECK(entry); | 482 DCHECK(entry); |
| 483 if (entry->GetVirtualURL().is_valid()) { | 483 if (entry->GetVirtualURL().is_valid()) { |
| 484 session_tab->navigations.push_back( | 484 session_tab->navigations.push_back( |
| 485 TabNavigation::FromNavigationEntry(i, *entry)); | 485 components::SerializedNavigationEntry::FromNavigationEntry(i, |
| 486 *entry)); |
| 486 } | 487 } |
| 487 } | 488 } |
| 488 session_tab->session_storage_persistent_id.clear(); | 489 session_tab->session_storage_persistent_id.clear(); |
| 489 } | 490 } |
| 490 | 491 |
| 491 void SessionModelAssociator::FaviconsUpdated( | 492 void SessionModelAssociator::FaviconsUpdated( |
| 492 const std::set<GURL>& urls) { | 493 const std::set<GURL>& urls) { |
| 493 // TODO(zea): consider a separate container for tabs with outstanding favicon | 494 // TODO(zea): consider a separate container for tabs with outstanding favicon |
| 494 // loads so we don't have to iterate through all tabs comparing urls. | 495 // loads so we don't have to iterate through all tabs comparing urls. |
| 495 for (std::set<GURL>::const_iterator i = urls.begin(); i != urls.end(); ++i) { | 496 for (std::set<GURL>::const_iterator i = urls.begin(); i != urls.end(); ++i) { |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 | 1160 |
| 1160 bool SessionModelAssociator::CryptoReadyIfNecessary() { | 1161 bool SessionModelAssociator::CryptoReadyIfNecessary() { |
| 1161 // We only access the cryptographer while holding a transaction. | 1162 // We only access the cryptographer while holding a transaction. |
| 1162 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 1163 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
| 1163 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); | 1164 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); |
| 1164 return !encrypted_types.Has(SESSIONS) || | 1165 return !encrypted_types.Has(SESSIONS) || |
| 1165 sync_service_->IsCryptographerReady(&trans); | 1166 sync_service_->IsCryptographerReady(&trans); |
| 1166 } | 1167 } |
| 1167 | 1168 |
| 1168 } // namespace browser_sync | 1169 } // namespace browser_sync |
| OLD | NEW |