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

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

Issue 1319473014: Introduce TabRestoreServiceClient and //chrome implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review 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 (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 #ifndef CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_
6 #define CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_ 6 #define CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/sessions/tab_restore_service.h" 13 #include "chrome/browser/sessions/tab_restore_service.h"
14 #include "chrome/browser/sessions/tab_restore_service_helper.h" 14 #include "chrome/browser/sessions/tab_restore_service_helper.h"
15 #include "components/sessions/core/tab_restore_service_client.h"
15 16
16 class Profile; 17 class Profile;
17 18
18 // Tab restore service that persists data on disk. 19 // Tab restore service that persists data on disk.
19 class PersistentTabRestoreService : public TabRestoreService { 20 class PersistentTabRestoreService : public TabRestoreService {
20 public: 21 public:
21 // Does not take ownership of |time_factory|. 22 // Does not take ownership of |time_factory|.
22 PersistentTabRestoreService(Profile* profile, 23 PersistentTabRestoreService(
23 TimeFactory* time_factory); 24 Profile* profile,
25 scoped_ptr<sessions::TabRestoreServiceClient> client,
26 TimeFactory* time_factory);
24 27
25 ~PersistentTabRestoreService() override; 28 ~PersistentTabRestoreService() override;
26 29
27 // TabRestoreService: 30 // TabRestoreService:
28 void AddObserver(TabRestoreServiceObserver* observer) override; 31 void AddObserver(TabRestoreServiceObserver* observer) override;
29 void RemoveObserver(TabRestoreServiceObserver* observer) override; 32 void RemoveObserver(TabRestoreServiceObserver* observer) override;
30 void CreateHistoricalTab(content::WebContents* contents, int index) override; 33 void CreateHistoricalTab(content::WebContents* contents, int index) override;
31 void BrowserClosing(TabRestoreServiceDelegate* delegate) override; 34 void BrowserClosing(TabRestoreServiceDelegate* delegate) override;
32 void BrowserClosed(TabRestoreServiceDelegate* delegate) override; 35 void BrowserClosed(TabRestoreServiceDelegate* delegate) override;
33 void ClearEntries() override; 36 void ClearEntries() override;
(...skipping 14 matching lines...) Expand all
48 51
49 private: 52 private:
50 friend class PersistentTabRestoreServiceTest; 53 friend class PersistentTabRestoreServiceTest;
51 54
52 class Delegate; 55 class Delegate;
53 56
54 // Exposed for testing. 57 // Exposed for testing.
55 Entries* mutable_entries(); 58 Entries* mutable_entries();
56 void PruneEntries(); 59 void PruneEntries();
57 60
61 scoped_ptr<sessions::TabRestoreServiceClient> client_;
58 scoped_ptr<Delegate> delegate_; 62 scoped_ptr<Delegate> delegate_;
59 TabRestoreServiceHelper helper_; 63 TabRestoreServiceHelper helper_;
60 64
61 DISALLOW_COPY_AND_ASSIGN(PersistentTabRestoreService); 65 DISALLOW_COPY_AND_ASSIGN(PersistentTabRestoreService);
62 }; 66 };
63 67
64 #endif // CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_ 68 #endif // CHROME_BROWSER_SESSIONS_PERSISTENT_TAB_RESTORE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/in_memory_tab_restore_service.cc ('k') | chrome/browser/sessions/persistent_tab_restore_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698