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_BASE_SESSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 SessionID::id_type tab_id, | 118 SessionID::id_type tab_id, |
119 int index, | 119 int index, |
120 const content::NavigationEntry& entry); | 120 const content::NavigationEntry& entry); |
121 | 121 |
122 // Creates a SessionCommand that represents marking a tab as an application. | 122 // Creates a SessionCommand that represents marking a tab as an application. |
123 SessionCommand* CreateSetTabExtensionAppIDCommand( | 123 SessionCommand* CreateSetTabExtensionAppIDCommand( |
124 SessionID::id_type command_id, | 124 SessionID::id_type command_id, |
125 SessionID::id_type tab_id, | 125 SessionID::id_type tab_id, |
126 const std::string& extension_id); | 126 const std::string& extension_id); |
127 | 127 |
| 128 // Creates a SessionCommand stores a browser window's app name. |
| 129 SessionCommand* CreateSetWindowAppNameCommand( |
| 130 SessionID::id_type command_id, |
| 131 SessionID::id_type window_id, |
| 132 const std::string& app_name); |
| 133 |
128 // Converts a SessionCommand previously created by | 134 // Converts a SessionCommand previously created by |
129 // CreateUpdateTabNavigationCommand into a TabNavigation. Returns true | 135 // CreateUpdateTabNavigationCommand into a TabNavigation. Returns true |
130 // on success. If successful |tab_id| is set to the id of the restored tab. | 136 // on success. If successful |tab_id| is set to the id of the restored tab. |
131 bool RestoreUpdateTabNavigationCommand(const SessionCommand& command, | 137 bool RestoreUpdateTabNavigationCommand(const SessionCommand& command, |
132 TabNavigation* navigation, | 138 TabNavigation* navigation, |
133 SessionID::id_type* tab_id); | 139 SessionID::id_type* tab_id); |
134 | 140 |
135 // Extracts a SessionCommand as previously created by | 141 // Extracts a SessionCommand as previously created by |
136 // CreateSetTabExtensionAppIDCommand into the tab id and application | 142 // CreateSetTabExtensionAppIDCommand into the tab id and application |
137 // extension id. | 143 // extension id. |
138 bool RestoreSetTabExtensionAppIDCommand( | 144 bool RestoreSetTabExtensionAppIDCommand( |
139 const SessionCommand& command, | 145 const SessionCommand& command, |
140 SessionID::id_type* tab_id, | 146 SessionID::id_type* tab_id, |
141 std::string* extension_app_id); | 147 std::string* extension_app_id); |
142 | 148 |
| 149 // Extracts a SessionCommand as previously created by |
| 150 // CreateSetWindowAppNameCommand into the window id and application name. |
| 151 bool RestoreSetWindowAppNameCommand( |
| 152 const SessionCommand& command, |
| 153 SessionID::id_type* window_id, |
| 154 std::string* app_name); |
| 155 |
143 // Returns true if the entry at specified |url| should be written to disk. | 156 // Returns true if the entry at specified |url| should be written to disk. |
144 bool ShouldTrackEntry(const GURL& url); | 157 bool ShouldTrackEntry(const GURL& url); |
145 | 158 |
146 // Invokes ReadLastSessionCommands with request on the backend thread. | 159 // Invokes ReadLastSessionCommands with request on the backend thread. |
147 // If testing, ReadLastSessionCommands is invoked directly. | 160 // If testing, ReadLastSessionCommands is invoked directly. |
148 Handle ScheduleGetLastSessionCommands( | 161 Handle ScheduleGetLastSessionCommands( |
149 InternalGetCommandsRequest* request, | 162 InternalGetCommandsRequest* request, |
150 CancelableRequestConsumerBase* consumer); | 163 CancelableRequestConsumerBase* consumer); |
151 | 164 |
152 // Returns true if we appear to be running in production, false if | 165 // Returns true if we appear to be running in production, false if |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // The number of commands sent to the backend before doing a reset. | 202 // The number of commands sent to the backend before doing a reset. |
190 int commands_since_reset_; | 203 int commands_since_reset_; |
191 | 204 |
192 // Whether to save the HTTP bodies of the POST requests. | 205 // Whether to save the HTTP bodies of the POST requests. |
193 bool save_post_data_; | 206 bool save_post_data_; |
194 | 207 |
195 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 208 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
196 }; | 209 }; |
197 | 210 |
198 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 211 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
OLD | NEW |