| 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 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // tabs and windows. When a tab is closed | 31 // tabs and windows. When a tab is closed |
| 32 // TabRestoreService::CreateHistoricalTab is invoked and a Tab is created to | 32 // TabRestoreService::CreateHistoricalTab is invoked and a Tab is created to |
| 33 // represent the tab. Similarly, when a browser is closed, BrowserClosing is | 33 // represent the tab. Similarly, when a browser is closed, BrowserClosing is |
| 34 // invoked and a Window is created to represent the window. | 34 // invoked and a Window is created to represent the window. |
| 35 // | 35 // |
| 36 // To restore a tab/window from the TabRestoreService invoke RestoreEntryById | 36 // To restore a tab/window from the TabRestoreService invoke RestoreEntryById |
| 37 // or RestoreMostRecentEntry. | 37 // or RestoreMostRecentEntry. |
| 38 // | 38 // |
| 39 // To listen for changes to the set of entries managed by the TabRestoreService | 39 // To listen for changes to the set of entries managed by the TabRestoreService |
| 40 // add an observer. | 40 // add an observer. |
| 41 class TabRestoreService : public ProfileKeyedService { | 41 class TabRestoreService : public BrowserContextKeyedService { |
| 42 public: | 42 public: |
| 43 // Interface used to allow the test to provide a custom time. | 43 // Interface used to allow the test to provide a custom time. |
| 44 class TimeFactory { | 44 class TimeFactory { |
| 45 public: | 45 public: |
| 46 virtual ~TimeFactory(); | 46 virtual ~TimeFactory(); |
| 47 virtual base::Time TimeNow() = 0; | 47 virtual base::Time TimeNow() = 0; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // The type of entry. | 50 // The type of entry. |
| 51 enum Type { | 51 enum Type { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 virtual void LoadTabsFromLastSession() = 0; | 180 virtual void LoadTabsFromLastSession() = 0; |
| 181 | 181 |
| 182 // Returns true if the tab entries have been loaded. | 182 // Returns true if the tab entries have been loaded. |
| 183 virtual bool IsLoaded() const = 0; | 183 virtual bool IsLoaded() const = 0; |
| 184 | 184 |
| 185 // Deletes the last session. | 185 // Deletes the last session. |
| 186 virtual void DeleteLastSession() = 0; | 186 virtual void DeleteLastSession() = 0; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 189 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
| OLD | NEW |