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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
529 NavigationEntry* entry = (i == pending_index) ? | 529 NavigationEntry* entry = (i == pending_index) ? |
530 controller->GetPendingEntry() : controller->GetEntryAtIndex(i); | 530 controller->GetPendingEntry() : controller->GetEntryAtIndex(i); |
531 tab->navigations[i].SetFromNavigationEntry(*entry); | 531 tab->navigations[i].SetFromNavigationEntry(*entry); |
532 } | 532 } |
533 tab->timestamp = TimeNow(); | 533 tab->timestamp = TimeNow(); |
534 tab->current_navigation_index = controller->GetCurrentEntryIndex(); | 534 tab->current_navigation_index = controller->GetCurrentEntryIndex(); |
535 if (tab->current_navigation_index == -1 && entry_count > 0) | 535 if (tab->current_navigation_index == -1 && entry_count > 0) |
536 tab->current_navigation_index = 0; | 536 tab->current_navigation_index = 0; |
537 tab->tabstrip_index = index; | 537 tab->tabstrip_index = index; |
538 | 538 |
539 #if !defined(OS_ANDROID) | |
Yaron
2012/08/01 20:45:02
I don't believe this is necessary. We now compile
felipeg
2012/08/02 13:07:01
Done.
| |
539 TabContents* tab_contents = | 540 TabContents* tab_contents = |
540 TabContents::FromWebContents(controller->GetWebContents()); | 541 TabContents::FromWebContents(controller->GetWebContents()); |
541 // tab_contents is NULL in some browser tests. | 542 // tab_contents is NULL in some browser tests. |
542 if (tab_contents) { | 543 if (tab_contents) { |
543 const extensions::Extension* extension = | 544 const extensions::Extension* extension = |
544 tab_contents->extension_tab_helper()->extension_app(); | 545 tab_contents->extension_tab_helper()->extension_app(); |
545 if (extension) | 546 if (extension) |
546 tab->extension_app_id = extension->id(); | 547 tab->extension_app_id = extension->id(); |
547 } | 548 } |
549 #endif | |
548 | 550 |
549 tab->session_storage_namespace = controller->GetSessionStorageNamespace(); | 551 tab->session_storage_namespace = controller->GetSessionStorageNamespace(); |
550 | 552 |
551 // Delegate may be NULL during unit tests. | 553 // Delegate may be NULL during unit tests. |
552 if (delegate) { | 554 if (delegate) { |
553 tab->browser_id = delegate->GetSessionID().id(); | 555 tab->browser_id = delegate->GetSessionID().id(); |
554 tab->pinned = delegate->IsTabPinned(tab->tabstrip_index); | 556 tab->pinned = delegate->IsTabPinned(tab->tabstrip_index); |
555 } | 557 } |
556 } | 558 } |
557 | 559 |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1244 // the front, not the end and we just added the entries to the end). | 1246 // the front, not the end and we just added the entries to the end). |
1245 entries_to_write_ = staging_entries_.size(); | 1247 entries_to_write_ = staging_entries_.size(); |
1246 | 1248 |
1247 PruneEntries(); | 1249 PruneEntries(); |
1248 NotifyTabsChanged(); | 1250 NotifyTabsChanged(); |
1249 } | 1251 } |
1250 | 1252 |
1251 Time TabRestoreService::TimeNow() const { | 1253 Time TabRestoreService::TimeNow() const { |
1252 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); | 1254 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); |
1253 } | 1255 } |
OLD | NEW |