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> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "chrome/browser/profiles/profile_keyed_service.h" | 14 #include "chrome/browser/profiles/profile_keyed_service.h" |
15 #include "chrome/browser/sessions/session_id.h" | 15 #include "chrome/browser/sessions/session_id.h" |
16 #include "chrome/browser/sessions/session_types.h" | 16 #include "chrome/browser/sessions/session_types.h" |
17 #include "chrome/browser/ui/host_desktop.h" | 17 #include "chrome/browser/ui/host_desktop.h" |
| 18 #include "components/sessions/serialized_navigation_entry.h" |
18 #include "content/public/browser/session_storage_namespace.h" | 19 #include "content/public/browser/session_storage_namespace.h" |
19 #include "ui/base/window_open_disposition.h" | 20 #include "ui/base/window_open_disposition.h" |
20 | 21 |
21 class TabRestoreServiceDelegate; | 22 class TabRestoreServiceDelegate; |
22 class TabRestoreServiceObserver; | 23 class TabRestoreServiceObserver; |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 class SessionStorageNamespace; | 26 class SessionStorageNamespace; |
26 class WebContents; | 27 class WebContents; |
27 } | 28 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 }; | 75 }; |
75 | 76 |
76 // Represents a previously open tab. | 77 // Represents a previously open tab. |
77 struct Tab : public Entry { | 78 struct Tab : public Entry { |
78 Tab(); | 79 Tab(); |
79 virtual ~Tab(); | 80 virtual ~Tab(); |
80 | 81 |
81 bool has_browser() const { return browser_id > 0; } | 82 bool has_browser() const { return browser_id > 0; } |
82 | 83 |
83 // The navigations. | 84 // The navigations. |
84 std::vector<TabNavigation> navigations; | 85 std::vector<sessions::SerializedNavigationEntry> navigations; |
85 | 86 |
86 // Index of the selected navigation in navigations. | 87 // Index of the selected navigation in navigations. |
87 int current_navigation_index; | 88 int current_navigation_index; |
88 | 89 |
89 // The ID of the browser to which this tab belonged, so it can be restored | 90 // The ID of the browser to which this tab belonged, so it can be restored |
90 // there. May be 0 (an invalid SessionID) when restoring an entire session. | 91 // there. May be 0 (an invalid SessionID) when restoring an entire session. |
91 SessionID::id_type browser_id; | 92 SessionID::id_type browser_id; |
92 | 93 |
93 // Index within the tab strip. May be -1 for an unknown index. | 94 // Index within the tab strip. May be -1 for an unknown index. |
94 int tabstrip_index; | 95 int tabstrip_index; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 virtual void LoadTabsFromLastSession() = 0; | 180 virtual void LoadTabsFromLastSession() = 0; |
180 | 181 |
181 // Returns true if the tab entries have been loaded. | 182 // Returns true if the tab entries have been loaded. |
182 virtual bool IsLoaded() const = 0; | 183 virtual bool IsLoaded() const = 0; |
183 | 184 |
184 // Deletes the last session. | 185 // Deletes the last session. |
185 virtual void DeleteLastSession() = 0; | 186 virtual void DeleteLastSession() = 0; |
186 }; | 187 }; |
187 | 188 |
188 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 189 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
OLD | NEW |