| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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" |
| 6 |
| 5 #include <algorithm> | 7 #include <algorithm> |
| 6 #include <iterator> | 8 #include <iterator> |
| 7 | 9 |
| 8 #include "chrome/browser/sessions/tab_restore_service.h" | 10 #include "base/scoped_vector.h" |
| 9 | 11 #include "base/stl_util-inl.h" |
| 10 #include "chrome/browser/browser_list.h" | 12 #include "chrome/browser/browser_list.h" |
| 11 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profile.h" |
| 12 #include "chrome/browser/sessions/session_service.h" | 14 #include "chrome/browser/sessions/session_service.h" |
| 13 #include "chrome/browser/sessions/session_command.h" | 15 #include "chrome/browser/sessions/session_command.h" |
| 14 #include "chrome/browser/tab_contents/navigation_controller.h" | 16 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 15 #include "chrome/browser/tab_contents/navigation_entry.h" | 17 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 16 #include "chrome/common/scoped_vector.h" | |
| 17 #include "chrome/common/stl_util-inl.h" | |
| 18 | 18 |
| 19 using base::Time; | 19 using base::Time; |
| 20 | 20 |
| 21 // Entry ---------------------------------------------------------------------- | 21 // Entry ---------------------------------------------------------------------- |
| 22 | 22 |
| 23 // ID of the next Entry. | 23 // ID of the next Entry. |
| 24 static SessionID::id_type next_entry_id = 1; | 24 static SessionID::id_type next_entry_id = 1; |
| 25 | 25 |
| 26 TabRestoreService::Entry::Entry() : id(next_entry_id++), type(TAB) {} | 26 TabRestoreService::Entry::Entry() : id(next_entry_id++), type(TAB) {} |
| 27 | 27 |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 // it doesn't delete them. | 789 // it doesn't delete them. |
| 790 staging_entries_.clear(); | 790 staging_entries_.clear(); |
| 791 | 791 |
| 792 // Make it so we rewrite all the tabs. We need to do this otherwise we won't | 792 // Make it so we rewrite all the tabs. We need to do this otherwise we won't |
| 793 // correctly write out the entries when Save is invoked (Save starts from | 793 // correctly write out the entries when Save is invoked (Save starts from |
| 794 // the front, not the end and we just added the entries to the end). | 794 // the front, not the end and we just added the entries to the end). |
| 795 entries_to_write_ = staging_entries_.size(); | 795 entries_to_write_ = staging_entries_.size(); |
| 796 | 796 |
| 797 PruneAndNotify(); | 797 PruneAndNotify(); |
| 798 } | 798 } |
| OLD | NEW |