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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // Creates and add entries to |entries| for each of the windows in |windows|. | 170 // Creates and add entries to |entries| for each of the windows in |windows|. |
171 void CreateEntriesFromWindows(std::vector<SessionWindow*>* windows, | 171 void CreateEntriesFromWindows(std::vector<SessionWindow*>* windows, |
172 std::vector<Entry*>* entries); | 172 std::vector<Entry*>* entries); |
173 | 173 |
174 protected: | 174 protected: |
175 virtual void Save() OVERRIDE; | 175 virtual void Save() OVERRIDE; |
176 | 176 |
177 private: | 177 private: |
178 friend class TabRestoreServiceTest; | 178 friend class TabRestoreServiceTest; |
179 FRIEND_TEST_ALL_PREFIXES(TabRestoreServiceTest, PruneEntries); | 179 FRIEND_TEST_ALL_PREFIXES(TabRestoreServiceTest, PruneEntries); |
| 180 FRIEND_TEST_ALL_PREFIXES(TabRestoreServiceTest, PruneIsCalled); |
180 | 181 |
181 // Used to indicate what has loaded. | 182 // Used to indicate what has loaded. |
182 enum LoadState { | 183 enum LoadState { |
183 // Indicates we haven't loaded anything. | 184 // Indicates we haven't loaded anything. |
184 NOT_LOADED = 1 << 0, | 185 NOT_LOADED = 1 << 0, |
185 | 186 |
186 // Indicates we've asked for the last sessions and tabs but haven't gotten | 187 // Indicates we've asked for the last sessions and tabs but haven't gotten |
187 // the result back yet. | 188 // the result back yet. |
188 LOADING = 1 << 2, | 189 LOADING = 1 << 2, |
189 | 190 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // loading LoadStateChanged is invoked, which adds these entries to | 356 // loading LoadStateChanged is invoked, which adds these entries to |
356 // entries_. | 357 // entries_. |
357 std::vector<Entry*> staging_entries_; | 358 std::vector<Entry*> staging_entries_; |
358 | 359 |
359 TimeFactory* time_factory_; | 360 TimeFactory* time_factory_; |
360 | 361 |
361 DISALLOW_COPY_AND_ASSIGN(TabRestoreService); | 362 DISALLOW_COPY_AND_ASSIGN(TabRestoreService); |
362 }; | 363 }; |
363 | 364 |
364 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 365 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
OLD | NEW |