Chromium Code Reviews| 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/persistent_tab_restore_service.h" | 5 #include "chrome/browser/sessions/persistent_tab_restore_service.h" |
| 6 | 6 |
| 7 #include <cstring> // memcpy | 7 #include <cstring> // memcpy |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 935 } | 935 } |
| 936 | 936 |
| 937 void PersistentTabRestoreService::ClearEntries() { | 937 void PersistentTabRestoreService::ClearEntries() { |
| 938 helper_.ClearEntries(); | 938 helper_.ClearEntries(); |
| 939 } | 939 } |
| 940 | 940 |
| 941 const TabRestoreService::Entries& PersistentTabRestoreService::entries() const { | 941 const TabRestoreService::Entries& PersistentTabRestoreService::entries() const { |
| 942 return helper_.entries(); | 942 return helper_.entries(); |
| 943 } | 943 } |
| 944 | 944 |
| 945 void PersistentTabRestoreService::RestoreMostRecentEntry( | 945 std::vector<content::WebContents*> |
| 946 TabRestoreServiceDelegate* delegate, | 946 PersistentTabRestoreService::RestoreMostRecentEntry( |
|
sky
2013/08/05 16:16:17
nit: don't indent this 4. Either none or 2 (not su
Kristen Dwan
2013/08/05 18:01:38
Done.
| |
| 947 chrome::HostDesktopType host_desktop_type) { | 947 TabRestoreServiceDelegate* delegate, |
| 948 helper_.RestoreMostRecentEntry(delegate, host_desktop_type); | 948 chrome::HostDesktopType host_desktop_type) { |
| 949 return helper_.RestoreMostRecentEntry(delegate, host_desktop_type); | |
| 949 } | 950 } |
| 950 | 951 |
| 951 TabRestoreService::Tab* PersistentTabRestoreService::RemoveTabEntryById( | 952 TabRestoreService::Tab* PersistentTabRestoreService::RemoveTabEntryById( |
| 952 SessionID::id_type id) { | 953 SessionID::id_type id) { |
| 953 return helper_.RemoveTabEntryById(id); | 954 return helper_.RemoveTabEntryById(id); |
| 954 } | 955 } |
| 955 | 956 |
| 956 void PersistentTabRestoreService::RestoreEntryById( | 957 std::vector<content::WebContents*> |
| 957 TabRestoreServiceDelegate* delegate, | 958 PersistentTabRestoreService::RestoreEntryById( |
| 958 SessionID::id_type id, | 959 TabRestoreServiceDelegate* delegate, |
| 959 chrome::HostDesktopType host_desktop_type, | 960 SessionID::id_type id, |
| 960 WindowOpenDisposition disposition) { | 961 chrome::HostDesktopType host_desktop_type, |
| 961 helper_.RestoreEntryById(delegate, id, host_desktop_type, disposition); | 962 WindowOpenDisposition disposition) { |
| 963 return helper_.RestoreEntryById(delegate, id, host_desktop_type, disposition); | |
| 962 } | 964 } |
| 963 | 965 |
| 964 bool PersistentTabRestoreService::IsLoaded() const { | 966 bool PersistentTabRestoreService::IsLoaded() const { |
| 965 return delegate_->IsLoaded(); | 967 return delegate_->IsLoaded(); |
| 966 } | 968 } |
| 967 | 969 |
| 968 void PersistentTabRestoreService::DeleteLastSession() { | 970 void PersistentTabRestoreService::DeleteLastSession() { |
| 969 return delegate_->DeleteLastSession(); | 971 return delegate_->DeleteLastSession(); |
| 970 } | 972 } |
| 971 | 973 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 982 } | 984 } |
| 983 | 985 |
| 984 void PersistentTabRestoreService::PruneEntries() { | 986 void PersistentTabRestoreService::PruneEntries() { |
| 985 helper_.PruneEntries(); | 987 helper_.PruneEntries(); |
| 986 } | 988 } |
| 987 | 989 |
| 988 BrowserContextKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( | 990 BrowserContextKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( |
| 989 content::BrowserContext* profile) const { | 991 content::BrowserContext* profile) const { |
| 990 return new PersistentTabRestoreService(static_cast<Profile*>(profile), NULL); | 992 return new PersistentTabRestoreService(static_cast<Profile*>(profile), NULL); |
| 991 } | 993 } |
| OLD | NEW |