| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // browser window) of the tab when it was closed will be respected if | 173 // browser window) of the tab when it was closed will be respected if |
| 174 // disposition is UNKNOWN. | 174 // disposition is UNKNOWN. |
| 175 void RestoreEntryById(TabRestoreServiceDelegate* delegate, | 175 void RestoreEntryById(TabRestoreServiceDelegate* delegate, |
| 176 SessionID::id_type id, | 176 SessionID::id_type id, |
| 177 WindowOpenDisposition disposition); | 177 WindowOpenDisposition disposition); |
| 178 | 178 |
| 179 // Loads the tabs and previous session. This does nothing if the tabs | 179 // Loads the tabs and previous session. This does nothing if the tabs |
| 180 // from the previous session have already been loaded. | 180 // from the previous session have already been loaded. |
| 181 void LoadTabsFromLastSession(); | 181 void LoadTabsFromLastSession(); |
| 182 | 182 |
| 183 // Returns true if the tab entries have been loaded. |
| 184 bool IsLoaded() const; |
| 185 |
| 183 // Max number of entries we'll keep around. | 186 // Max number of entries we'll keep around. |
| 184 static const size_t kMaxEntries; | 187 static const size_t kMaxEntries; |
| 185 | 188 |
| 186 // Creates and add entries to |entries| for each of the windows in |windows|. | 189 // Creates and add entries to |entries| for each of the windows in |windows|. |
| 187 void CreateEntriesFromWindows(std::vector<SessionWindow*>* windows, | 190 void CreateEntriesFromWindows(std::vector<SessionWindow*>* windows, |
| 188 std::vector<Entry*>* entries); | 191 std::vector<Entry*>* entries); |
| 189 | 192 |
| 190 protected: | 193 protected: |
| 191 // ProfileKeyedService: | 194 // ProfileKeyedService: |
| 192 virtual void Shutdown() OVERRIDE; | 195 virtual void Shutdown() OVERRIDE; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 // loading LoadStateChanged is invoked, which adds these entries to | 379 // loading LoadStateChanged is invoked, which adds these entries to |
| 377 // entries_. | 380 // entries_. |
| 378 std::vector<Entry*> staging_entries_; | 381 std::vector<Entry*> staging_entries_; |
| 379 | 382 |
| 380 TimeFactory* time_factory_; | 383 TimeFactory* time_factory_; |
| 381 | 384 |
| 382 DISALLOW_COPY_AND_ASSIGN(TabRestoreService); | 385 DISALLOW_COPY_AND_ASSIGN(TabRestoreService); |
| 383 }; | 386 }; |
| 384 | 387 |
| 385 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 388 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
| OLD | NEW |