Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: chrome/browser/sessions/persistent_tab_restore_service.cc

Issue 1342743002: Remove Profile and HostDesktopType dependencies from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 return; 919 return;
920 } 920 }
921 } 921 }
922 } 922 }
923 } 923 }
924 } 924 }
925 925
926 // PersistentTabRestoreService ------------------------------------------------- 926 // PersistentTabRestoreService -------------------------------------------------
927 927
928 PersistentTabRestoreService::PersistentTabRestoreService( 928 PersistentTabRestoreService::PersistentTabRestoreService(
929 Profile* profile,
930 scoped_ptr<sessions::TabRestoreServiceClient> client, 929 scoped_ptr<sessions::TabRestoreServiceClient> client,
931 TimeFactory* time_factory) 930 TimeFactory* time_factory)
932 : client_(client.Pass()), 931 : client_(client.Pass()),
933 delegate_(new Delegate(client_.get())), 932 delegate_(new Delegate(client_.get())),
934 helper_(this, delegate_.get(), profile, client_.get(), time_factory) { 933 helper_(this, delegate_.get(), client_.get(), time_factory) {
935 delegate_->set_tab_restore_service_helper(&helper_); 934 delegate_->set_tab_restore_service_helper(&helper_);
936 } 935 }
937 936
938 PersistentTabRestoreService::~PersistentTabRestoreService() {} 937 PersistentTabRestoreService::~PersistentTabRestoreService() {}
939 938
940 void PersistentTabRestoreService::AddObserver( 939 void PersistentTabRestoreService::AddObserver(
941 TabRestoreServiceObserver* observer) { 940 TabRestoreServiceObserver* observer) {
942 helper_.AddObserver(observer); 941 helper_.AddObserver(observer);
943 } 942 }
944 943
(...skipping 22 matching lines...) Expand all
967 helper_.ClearEntries(); 966 helper_.ClearEntries();
968 } 967 }
969 968
970 const TabRestoreService::Entries& PersistentTabRestoreService::entries() const { 969 const TabRestoreService::Entries& PersistentTabRestoreService::entries() const {
971 return helper_.entries(); 970 return helper_.entries();
972 } 971 }
973 972
974 std::vector<content::WebContents*> 973 std::vector<content::WebContents*>
975 PersistentTabRestoreService::RestoreMostRecentEntry( 974 PersistentTabRestoreService::RestoreMostRecentEntry(
976 TabRestoreServiceDelegate* delegate, 975 TabRestoreServiceDelegate* delegate,
977 chrome::HostDesktopType host_desktop_type) { 976 int host_desktop_type) {
978 return helper_.RestoreMostRecentEntry(delegate, host_desktop_type); 977 return helper_.RestoreMostRecentEntry(delegate, host_desktop_type);
979 } 978 }
980 979
981 TabRestoreService::Tab* PersistentTabRestoreService::RemoveTabEntryById( 980 TabRestoreService::Tab* PersistentTabRestoreService::RemoveTabEntryById(
982 SessionID::id_type id) { 981 SessionID::id_type id) {
983 return helper_.RemoveTabEntryById(id); 982 return helper_.RemoveTabEntryById(id);
984 } 983 }
985 984
986 std::vector<content::WebContents*> 985 std::vector<content::WebContents*>
987 PersistentTabRestoreService::RestoreEntryById( 986 PersistentTabRestoreService::RestoreEntryById(
988 TabRestoreServiceDelegate* delegate, 987 TabRestoreServiceDelegate* delegate,
989 SessionID::id_type id, 988 SessionID::id_type id,
990 chrome::HostDesktopType host_desktop_type, 989 int host_desktop_type,
991 WindowOpenDisposition disposition) { 990 WindowOpenDisposition disposition) {
992 return helper_.RestoreEntryById(delegate, id, host_desktop_type, disposition); 991 return helper_.RestoreEntryById(delegate, id, host_desktop_type, disposition);
993 } 992 }
994 993
995 bool PersistentTabRestoreService::IsLoaded() const { 994 bool PersistentTabRestoreService::IsLoaded() const {
996 return delegate_->IsLoaded(); 995 return delegate_->IsLoaded();
997 } 996 }
998 997
999 void PersistentTabRestoreService::DeleteLastSession() { 998 void PersistentTabRestoreService::DeleteLastSession() {
1000 return delegate_->DeleteLastSession(); 999 return delegate_->DeleteLastSession();
1001 } 1000 }
1002 1001
1003 void PersistentTabRestoreService::Shutdown() { 1002 void PersistentTabRestoreService::Shutdown() {
1004 return delegate_->Shutdown(); 1003 return delegate_->Shutdown();
1005 } 1004 }
1006 1005
1007 void PersistentTabRestoreService::LoadTabsFromLastSession() { 1006 void PersistentTabRestoreService::LoadTabsFromLastSession() {
1008 delegate_->LoadTabsFromLastSession(); 1007 delegate_->LoadTabsFromLastSession();
1009 } 1008 }
1010 1009
1011 TabRestoreService::Entries* PersistentTabRestoreService::mutable_entries() { 1010 TabRestoreService::Entries* PersistentTabRestoreService::mutable_entries() {
1012 return &helper_.entries_; 1011 return &helper_.entries_;
1013 } 1012 }
1014 1013
1015 void PersistentTabRestoreService::PruneEntries() { 1014 void PersistentTabRestoreService::PruneEntries() {
1016 helper_.PruneEntries(); 1015 helper_.PruneEntries();
1017 } 1016 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698