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 that containing user agent override used by a |
| 129 // tab's navigations. |
| 130 SessionCommand* CreateSetTabUserAgentOverrideCommand( |
| 131 SessionID::id_type command_id, |
| 132 SessionID::id_type tab_id, |
| 133 const std::string& user_agent_override); |
| 134 |
128 // Creates a SessionCommand stores a browser window's app name. | 135 // Creates a SessionCommand stores a browser window's app name. |
129 SessionCommand* CreateSetWindowAppNameCommand( | 136 SessionCommand* CreateSetWindowAppNameCommand( |
130 SessionID::id_type command_id, | 137 SessionID::id_type command_id, |
131 SessionID::id_type window_id, | 138 SessionID::id_type window_id, |
132 const std::string& app_name); | 139 const std::string& app_name); |
133 | 140 |
134 // Converts a SessionCommand previously created by | 141 // Converts a SessionCommand previously created by |
135 // CreateUpdateTabNavigationCommand into a TabNavigation. Returns true | 142 // CreateUpdateTabNavigationCommand into a TabNavigation. Returns true |
136 // on success. If successful |tab_id| is set to the id of the restored tab. | 143 // on success. If successful |tab_id| is set to the id of the restored tab. |
137 bool RestoreUpdateTabNavigationCommand(const SessionCommand& command, | 144 bool RestoreUpdateTabNavigationCommand(const SessionCommand& command, |
138 TabNavigation* navigation, | 145 TabNavigation* navigation, |
139 SessionID::id_type* tab_id); | 146 SessionID::id_type* tab_id); |
140 | 147 |
141 // Extracts a SessionCommand as previously created by | 148 // Extracts a SessionCommand as previously created by |
142 // CreateSetTabExtensionAppIDCommand into the tab id and application | 149 // CreateSetTabExtensionAppIDCommand into the tab id and application |
143 // extension id. | 150 // extension id. |
144 bool RestoreSetTabExtensionAppIDCommand( | 151 bool RestoreSetTabExtensionAppIDCommand( |
145 const SessionCommand& command, | 152 const SessionCommand& command, |
146 SessionID::id_type* tab_id, | 153 SessionID::id_type* tab_id, |
147 std::string* extension_app_id); | 154 std::string* extension_app_id); |
148 | 155 |
149 // Extracts a SessionCommand as previously created by | 156 // Extracts a SessionCommand as previously created by |
| 157 // CreateSetTabUserAgentOverrideCommand into the tab id and user agent. |
| 158 bool RestoreSetTabUserAgentOverrideCommand( |
| 159 const SessionCommand& command, |
| 160 SessionID::id_type* tab_id, |
| 161 std::string* user_agent_override); |
| 162 |
| 163 // Extracts a SessionCommand as previously created by |
150 // CreateSetWindowAppNameCommand into the window id and application name. | 164 // CreateSetWindowAppNameCommand into the window id and application name. |
151 bool RestoreSetWindowAppNameCommand( | 165 bool RestoreSetWindowAppNameCommand( |
152 const SessionCommand& command, | 166 const SessionCommand& command, |
153 SessionID::id_type* window_id, | 167 SessionID::id_type* window_id, |
154 std::string* app_name); | 168 std::string* app_name); |
155 | 169 |
156 // Returns true if the entry at specified |url| should be written to disk. | 170 // Returns true if the entry at specified |url| should be written to disk. |
157 bool ShouldTrackEntry(const GURL& url); | 171 bool ShouldTrackEntry(const GURL& url); |
158 | 172 |
159 // Invokes ReadLastSessionCommands with request on the backend thread. | 173 // Invokes ReadLastSessionCommands with request on the backend thread. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // The number of commands sent to the backend before doing a reset. | 209 // The number of commands sent to the backend before doing a reset. |
196 int commands_since_reset_; | 210 int commands_since_reset_; |
197 | 211 |
198 // Whether to save the HTTP bodies of the POST requests. | 212 // Whether to save the HTTP bodies of the POST requests. |
199 bool save_post_data_; | 213 bool save_post_data_; |
200 | 214 |
201 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 215 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
202 }; | 216 }; |
203 | 217 |
204 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 218 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
OLD | NEW |