OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void LoadTabsFromLastSession(); | 164 void LoadTabsFromLastSession(); |
165 | 165 |
166 // Max number of entries we'll keep around. | 166 // Max number of entries we'll keep around. |
167 static const size_t kMaxEntries; | 167 static const size_t kMaxEntries; |
168 | 168 |
169 // Creates and add entries to |entries| for each of the windows in |windows|. | 169 // Creates and add entries to |entries| for each of the windows in |windows|. |
170 void CreateEntriesFromWindows(std::vector<SessionWindow*>* windows, | 170 void CreateEntriesFromWindows(std::vector<SessionWindow*>* windows, |
171 std::vector<Entry*>* entries); | 171 std::vector<Entry*>* entries); |
172 | 172 |
173 protected: | 173 protected: |
174 virtual void Save(); | 174 virtual void Save() OVERRIDE; |
175 | 175 |
176 private: | 176 private: |
177 // Used to indicate what has loaded. | 177 // Used to indicate what has loaded. |
178 enum LoadState { | 178 enum LoadState { |
179 // Indicates we haven't loaded anything. | 179 // Indicates we haven't loaded anything. |
180 NOT_LOADED = 1 << 0, | 180 NOT_LOADED = 1 << 0, |
181 | 181 |
182 // Indicates we've asked for the last sessions and tabs but haven't gotten | 182 // Indicates we've asked for the last sessions and tabs but haven't gotten |
183 // the result back yet. | 183 // the result back yet. |
184 LOADING = 1 << 2, | 184 LOADING = 1 << 2, |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 // loading LoadStateChanged is invoked, which adds these entries to | 337 // loading LoadStateChanged is invoked, which adds these entries to |
338 // entries_. | 338 // entries_. |
339 std::vector<Entry*> staging_entries_; | 339 std::vector<Entry*> staging_entries_; |
340 | 340 |
341 TimeFactory* time_factory_; | 341 TimeFactory* time_factory_; |
342 | 342 |
343 DISALLOW_COPY_AND_ASSIGN(TabRestoreService); | 343 DISALLOW_COPY_AND_ASSIGN(TabRestoreService); |
344 }; | 344 }; |
345 | 345 |
346 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 346 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
OLD | NEW |