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/sessions/tab_restore_service.h" | 5 #include "chrome/browser/sessions/tab_restore_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 tab->current_navigation_index = controller->GetCurrentEntryIndex(); | 530 tab->current_navigation_index = controller->GetCurrentEntryIndex(); |
531 if (tab->current_navigation_index == -1 && entry_count > 0) | 531 if (tab->current_navigation_index == -1 && entry_count > 0) |
532 tab->current_navigation_index = 0; | 532 tab->current_navigation_index = 0; |
533 tab->tabstrip_index = index; | 533 tab->tabstrip_index = index; |
534 | 534 |
535 TabContentsWrapper* wrapper = | 535 TabContentsWrapper* wrapper = |
536 TabContentsWrapper::GetCurrentWrapperForContents( | 536 TabContentsWrapper::GetCurrentWrapperForContents( |
537 controller->GetWebContents()); | 537 controller->GetWebContents()); |
538 // wrapper is NULL in some browser tests. | 538 // wrapper is NULL in some browser tests. |
539 if (wrapper) { | 539 if (wrapper) { |
540 const Extension* extension = | 540 const extensions::Extension* extension = |
541 wrapper->extension_tab_helper()->extension_app(); | 541 wrapper->extension_tab_helper()->extension_app(); |
542 if (extension) | 542 if (extension) |
543 tab->extension_app_id = extension->id(); | 543 tab->extension_app_id = extension->id(); |
544 } | 544 } |
545 | 545 |
546 tab->session_storage_namespace = controller->GetSessionStorageNamespace(); | 546 tab->session_storage_namespace = controller->GetSessionStorageNamespace(); |
547 | 547 |
548 // Delegate may be NULL during unit tests. | 548 // Delegate may be NULL during unit tests. |
549 if (delegate) { | 549 if (delegate) { |
550 tab->browser_id = delegate->GetSessionID().id(); | 550 tab->browser_id = delegate->GetSessionID().id(); |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 // the front, not the end and we just added the entries to the end). | 1241 // the front, not the end and we just added the entries to the end). |
1242 entries_to_write_ = staging_entries_.size(); | 1242 entries_to_write_ = staging_entries_.size(); |
1243 | 1243 |
1244 PruneEntries(); | 1244 PruneEntries(); |
1245 NotifyTabsChanged(); | 1245 NotifyTabsChanged(); |
1246 } | 1246 } |
1247 | 1247 |
1248 Time TabRestoreService::TimeNow() const { | 1248 Time TabRestoreService::TimeNow() const { |
1249 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); | 1249 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); |
1250 } | 1250 } |
OLD | NEW |