| 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> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 // Is this entry from the last session? This is set to true for entries that | 71 // Is this entry from the last session? This is set to true for entries that |
| 72 // were closed during the last session, and false for entries that were | 72 // were closed during the last session, and false for entries that were |
| 73 // closed during this session. | 73 // closed during this session. |
| 74 bool from_last_session; | 74 bool from_last_session; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 // Represents a previously open tab. | 77 // Represents a previously open tab. |
| 78 struct Tab : public Entry { | 78 struct Tab : public Entry { |
| 79 Tab(); | 79 Tab(); |
| 80 virtual ~Tab(); | 80 ~Tab() override; |
| 81 | 81 |
| 82 bool has_browser() const { return browser_id > 0; } | 82 bool has_browser() const { return browser_id > 0; } |
| 83 | 83 |
| 84 // The navigations. | 84 // The navigations. |
| 85 std::vector<sessions::SerializedNavigationEntry> navigations; | 85 std::vector<sessions::SerializedNavigationEntry> navigations; |
| 86 | 86 |
| 87 // Index of the selected navigation in navigations. | 87 // Index of the selected navigation in navigations. |
| 88 int current_navigation_index; | 88 int current_navigation_index; |
| 89 | 89 |
| 90 // 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 103 // The associated session storage namespace (if any). | 103 // The associated session storage namespace (if any). |
| 104 scoped_refptr<content::SessionStorageNamespace> session_storage_namespace; | 104 scoped_refptr<content::SessionStorageNamespace> session_storage_namespace; |
| 105 | 105 |
| 106 // The user agent override used for the tab's navigations (if applicable). | 106 // The user agent override used for the tab's navigations (if applicable). |
| 107 std::string user_agent_override; | 107 std::string user_agent_override; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 // Represents a previously open window. | 110 // Represents a previously open window. |
| 111 struct Window : public Entry { | 111 struct Window : public Entry { |
| 112 Window(); | 112 Window(); |
| 113 virtual ~Window(); | 113 ~Window() override; |
| 114 | 114 |
| 115 // The tabs that comprised the window, in order. | 115 // The tabs that comprised the window, in order. |
| 116 std::vector<Tab> tabs; | 116 std::vector<Tab> tabs; |
| 117 | 117 |
| 118 // Index of the selected tab. | 118 // Index of the selected tab. |
| 119 int selected_tab_index; | 119 int selected_tab_index; |
| 120 | 120 |
| 121 // If an application window, the name of the app. | 121 // If an application window, the name of the app. |
| 122 std::string app_name; | 122 std::string app_name; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 typedef std::list<Entry*> Entries; | 125 typedef std::list<Entry*> Entries; |
| 126 | 126 |
| 127 virtual ~TabRestoreService(); | 127 ~TabRestoreService() override; |
| 128 | 128 |
| 129 // Adds/removes an observer. TabRestoreService does not take ownership of | 129 // Adds/removes an observer. TabRestoreService does not take ownership of |
| 130 // the observer. | 130 // the observer. |
| 131 virtual void AddObserver(TabRestoreServiceObserver* observer) = 0; | 131 virtual void AddObserver(TabRestoreServiceObserver* observer) = 0; |
| 132 virtual void RemoveObserver(TabRestoreServiceObserver* observer) = 0; | 132 virtual void RemoveObserver(TabRestoreServiceObserver* observer) = 0; |
| 133 | 133 |
| 134 // Creates a Tab to represent |contents| and notifies observers the list of | 134 // Creates a Tab to represent |contents| and notifies observers the list of |
| 135 // entries has changed. | 135 // entries has changed. |
| 136 virtual void CreateHistoricalTab(content::WebContents* contents, | 136 virtual void CreateHistoricalTab(content::WebContents* contents, |
| 137 int index) = 0; | 137 int index) = 0; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 virtual void LoadTabsFromLastSession() = 0; | 183 virtual void LoadTabsFromLastSession() = 0; |
| 184 | 184 |
| 185 // Returns true if the tab entries have been loaded. | 185 // Returns true if the tab entries have been loaded. |
| 186 virtual bool IsLoaded() const = 0; | 186 virtual bool IsLoaded() const = 0; |
| 187 | 187 |
| 188 // Deletes the last session. | 188 // Deletes the last session. |
| 189 virtual void DeleteLastSession() = 0; | 189 virtual void DeleteLastSession() = 0; |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ | 192 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ |
| OLD | NEW |