| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "chrome/browser/in_process_webkit/session_storage_namespace.h" |
| 15 #include "chrome/browser/sessions/base_session_service.h" | 16 #include "chrome/browser/sessions/base_session_service.h" |
| 16 #include "chrome/browser/sessions/session_id.h" | 17 #include "chrome/browser/sessions/session_id.h" |
| 17 #include "chrome/browser/sessions/session_types.h" | 18 #include "chrome/browser/sessions/session_types.h" |
| 18 | 19 |
| 19 class Browser; | 20 class Browser; |
| 20 class NavigationController; | 21 class NavigationController; |
| 21 class Profile; | 22 class Profile; |
| 23 class TabRestoreServiceObserver; |
| 22 struct SessionWindow; | 24 struct SessionWindow; |
| 23 class TabRestoreServiceObserver; | |
| 24 | 25 |
| 25 // TabRestoreService is responsible for maintaining the most recently closed | 26 // TabRestoreService is responsible for maintaining the most recently closed |
| 26 // tabs and windows. When a tab is closed | 27 // tabs and windows. When a tab is closed |
| 27 // TabRestoreService::CreateHistoricalTab is invoked and a Tab is created to | 28 // TabRestoreService::CreateHistoricalTab is invoked and a Tab is created to |
| 28 // represent the tab. Similarly, when a browser is closed, BrowserClosing is | 29 // represent the tab. Similarly, when a browser is closed, BrowserClosing is |
| 29 // invoked and a Window is created to represent the window. | 30 // invoked and a Window is created to represent the window. |
| 30 // | 31 // |
| 31 // To restore a tab/window from the TabRestoreService invoke RestoreEntryById | 32 // To restore a tab/window from the TabRestoreService invoke RestoreEntryById |
| 32 // or RestoreMostRecentEntry. | 33 // or RestoreMostRecentEntry. |
| 33 // | 34 // |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 SessionID::id_type browser_id; | 88 SessionID::id_type browser_id; |
| 88 | 89 |
| 89 // Index within the tab strip. May be -1 for an unknown index. | 90 // Index within the tab strip. May be -1 for an unknown index. |
| 90 int tabstrip_index; | 91 int tabstrip_index; |
| 91 | 92 |
| 92 // True if the tab was pinned. | 93 // True if the tab was pinned. |
| 93 bool pinned; | 94 bool pinned; |
| 94 | 95 |
| 95 // If non-empty gives the id of the extension for the tab. | 96 // If non-empty gives the id of the extension for the tab. |
| 96 std::string extension_app_id; | 97 std::string extension_app_id; |
| 98 |
| 99 // The associated session storage namespace (if any). |
| 100 scoped_refptr<SessionStorageNamespace> session_storage_namespace; |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 // Represents a previously open window. | 103 // Represents a previously open window. |
| 100 struct Window : public Entry { | 104 struct Window : public Entry { |
| 101 Window(); | 105 Window(); |
| 102 virtual ~Window(); | 106 virtual ~Window(); |
| 103 | 107 |
| 104 // The tabs that comprised the window, in order. | 108 // The tabs that comprised the window, in order. |
| 105 std::vector<Tab> tabs; | 109 std::vector<Tab> tabs; |
| 106 | 110 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 // entries_. | 334 // entries_. |
| 331 std::vector<Entry*> staging_entries_; | 335 std::vector<Entry*> staging_entries_; |
| 332 | 336 |
| 333 TimeFactory* time_factory_; | 337 TimeFactory* time_factory_; |
| 334 | 338 |
| 335 DISALLOW_COPY_AND_ASSIGN(TabRestoreService); | 339 DISALLOW_COPY_AND_ASSIGN(TabRestoreService); |
| 336 }; | 340 }; |
| 337 | 341 |
| 338 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 342 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
| 339 | 343 |
| OLD | NEW |