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

Side by Side Diff: components/sessions/core/persistent_tab_restore_service.h

Issue 1350653004: [sessions] Properly namespace recently-componentized 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 (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 COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ 5 #ifndef COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_
6 #define COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ 6 #define COMPONENTS_SESSIONS_CORE_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 "components/sessions/core/tab_restore_service.h" 13 #include "components/sessions/core/tab_restore_service.h"
14 #include "components/sessions/core/tab_restore_service_client.h" 14 #include "components/sessions/core/tab_restore_service_client.h"
15 #include "components/sessions/core/tab_restore_service_helper.h" 15 #include "components/sessions/core/tab_restore_service_helper.h"
16 #include "components/sessions/sessions_export.h" 16 #include "components/sessions/sessions_export.h"
17 17
18 class PersistentTabRestoreServiceTest;
19
20 namespace sessions {
21
18 // Tab restore service that persists data on disk. 22 // Tab restore service that persists data on disk.
19 class SESSIONS_EXPORT PersistentTabRestoreService : public TabRestoreService { 23 class SESSIONS_EXPORT PersistentTabRestoreService : public TabRestoreService {
20 public: 24 public:
21 // Does not take ownership of |time_factory|. 25 // Does not take ownership of |time_factory|.
22 PersistentTabRestoreService( 26 PersistentTabRestoreService(scoped_ptr<TabRestoreServiceClient> client,
23 scoped_ptr<sessions::TabRestoreServiceClient> client, 27 TimeFactory* time_factory);
24 TimeFactory* time_factory);
25 28
26 ~PersistentTabRestoreService() override; 29 ~PersistentTabRestoreService() override;
27 30
28 // TabRestoreService: 31 // TabRestoreService:
29 void AddObserver(TabRestoreServiceObserver* observer) override; 32 void AddObserver(TabRestoreServiceObserver* observer) override;
30 void RemoveObserver(TabRestoreServiceObserver* observer) override; 33 void RemoveObserver(TabRestoreServiceObserver* observer) override;
31 void CreateHistoricalTab(sessions::LiveTab* live_tab, int index) override; 34 void CreateHistoricalTab(LiveTab* live_tab, int index) override;
32 void BrowserClosing(TabRestoreServiceDelegate* delegate) override; 35 void BrowserClosing(TabRestoreServiceDelegate* delegate) override;
33 void BrowserClosed(TabRestoreServiceDelegate* delegate) override; 36 void BrowserClosed(TabRestoreServiceDelegate* delegate) override;
34 void ClearEntries() override; 37 void ClearEntries() override;
35 const Entries& entries() const override; 38 const Entries& entries() const override;
36 std::vector<sessions::LiveTab*> RestoreMostRecentEntry( 39 std::vector<LiveTab*> RestoreMostRecentEntry(
37 TabRestoreServiceDelegate* delegate, 40 TabRestoreServiceDelegate* delegate,
38 int host_desktop_type) override; 41 int host_desktop_type) override;
39 Tab* RemoveTabEntryById(SessionID::id_type id) override; 42 Tab* RemoveTabEntryById(SessionID::id_type id) override;
40 std::vector<sessions::LiveTab*> RestoreEntryById( 43 std::vector<LiveTab*> RestoreEntryById(
41 TabRestoreServiceDelegate* delegate, 44 TabRestoreServiceDelegate* delegate,
42 SessionID::id_type id, 45 SessionID::id_type id,
43 int host_desktop_type, 46 int host_desktop_type,
44 WindowOpenDisposition disposition) override; 47 WindowOpenDisposition disposition) override;
45 void LoadTabsFromLastSession() override; 48 void LoadTabsFromLastSession() override;
46 bool IsLoaded() const override; 49 bool IsLoaded() const override;
47 void DeleteLastSession() override; 50 void DeleteLastSession() override;
48 void Shutdown() override; 51 void Shutdown() override;
49 52
50 private: 53 private:
51 friend class PersistentTabRestoreServiceTest; 54 friend class ::PersistentTabRestoreServiceTest;
52 55
53 class Delegate; 56 class Delegate;
54 57
55 // Exposed for testing. 58 // Exposed for testing.
56 Entries* mutable_entries(); 59 Entries* mutable_entries();
57 void PruneEntries(); 60 void PruneEntries();
58 61
59 scoped_ptr<sessions::TabRestoreServiceClient> client_; 62 scoped_ptr<TabRestoreServiceClient> client_;
60 scoped_ptr<Delegate> delegate_; 63 scoped_ptr<Delegate> delegate_;
61 TabRestoreServiceHelper helper_; 64 TabRestoreServiceHelper helper_;
62 65
63 DISALLOW_COPY_AND_ASSIGN(PersistentTabRestoreService); 66 DISALLOW_COPY_AND_ASSIGN(PersistentTabRestoreService);
64 }; 67 };
65 68
69 } // namespace sessions
70
66 #endif // COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_ 71 #endif // COMPONENTS_SESSIONS_CORE_PERSISTENT_TAB_RESTORE_SERVICE_H_
OLDNEW
« no previous file with comments | « components/sessions/core/live_tab.h ('k') | components/sessions/core/persistent_tab_restore_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698