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_SESSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
6 #define CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 6 #define CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 // Sets the index of the selected entry in the navigation controller for the | 159 // Sets the index of the selected entry in the navigation controller for the |
160 // specified tab. | 160 // specified tab. |
161 void SetSelectedNavigationIndex(const SessionID& window_id, | 161 void SetSelectedNavigationIndex(const SessionID& window_id, |
162 const SessionID& tab_id, | 162 const SessionID& tab_id, |
163 int index); | 163 int index); |
164 | 164 |
165 // Sets the index of the selected tab in the specified window. | 165 // Sets the index of the selected tab in the specified window. |
166 void SetSelectedTabInWindow(const SessionID& window_id, int index); | 166 void SetSelectedTabInWindow(const SessionID& window_id, int index); |
167 | 167 |
| 168 // Sets the user agent override of the specified tab. |
| 169 void SetTabUserAgentOverride(const SessionID& window_id, |
| 170 const SessionID& tab_id, |
| 171 const std::string& user_agent_override); |
| 172 |
168 // Callback from GetSavedSession of GetLastSession. | 173 // Callback from GetSavedSession of GetLastSession. |
169 // | 174 // |
170 // The contents of the supplied vector are deleted after the callback is | 175 // The contents of the supplied vector are deleted after the callback is |
171 // notified. To take ownership of the vector clear it before returning. | 176 // notified. To take ownership of the vector clear it before returning. |
172 // | 177 // |
173 // The time gives the time the session was closed. | 178 // The time gives the time the session was closed. |
174 typedef base::Callback<void(Handle, std::vector<SessionWindow*>*)> | 179 typedef base::Callback<void(Handle, std::vector<SessionWindow*>*)> |
175 SessionCallback; | 180 SessionCallback; |
176 | 181 |
177 // Fetches the contents of the last session, notifying the callback when | 182 // Fetches the contents of the last session, notifying the callback when |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 217 |
213 virtual void Observe(int type, | 218 virtual void Observe(int type, |
214 const content::NotificationSource& source, | 219 const content::NotificationSource& source, |
215 const content::NotificationDetails& details) OVERRIDE; | 220 const content::NotificationDetails& details) OVERRIDE; |
216 | 221 |
217 // Sets the application extension id of the specified tab. | 222 // Sets the application extension id of the specified tab. |
218 void SetTabExtensionAppID(const SessionID& window_id, | 223 void SetTabExtensionAppID(const SessionID& window_id, |
219 const SessionID& tab_id, | 224 const SessionID& tab_id, |
220 const std::string& extension_app_id); | 225 const std::string& extension_app_id); |
221 | 226 |
222 // Sets the user agent override of the specified tab. | |
223 void SetTabUserAgentOverride(const SessionID& window_id, | |
224 const SessionID& tab_id, | |
225 const std::string& user_agent_override); | |
226 | |
227 // Methods to create the various commands. It is up to the caller to delete | 227 // Methods to create the various commands. It is up to the caller to delete |
228 // the returned the SessionCommand* object. | 228 // the returned the SessionCommand* object. |
229 SessionCommand* CreateSetSelectedTabInWindow(const SessionID& window_id, | 229 SessionCommand* CreateSetSelectedTabInWindow(const SessionID& window_id, |
230 int index); | 230 int index); |
231 | 231 |
232 SessionCommand* CreateSetTabWindowCommand(const SessionID& window_id, | 232 SessionCommand* CreateSetTabWindowCommand(const SessionID& window_id, |
233 const SessionID& tab_id); | 233 const SessionID& tab_id); |
234 | 234 |
235 SessionCommand* CreateSetWindowBoundsCommand(const SessionID& window_id, | 235 SessionCommand* CreateSetWindowBoundsCommand(const SessionID& window_id, |
236 const gfx::Rect& bounds, | 236 const gfx::Rect& bounds, |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 const base::TimeDelta save_delay_in_hrs_; | 472 const base::TimeDelta save_delay_in_hrs_; |
473 | 473 |
474 // For browser_tests, since we want to simulate the browser shutting down | 474 // For browser_tests, since we want to simulate the browser shutting down |
475 // without quitting. | 475 // without quitting. |
476 bool force_browser_not_alive_with_no_windows_; | 476 bool force_browser_not_alive_with_no_windows_; |
477 | 477 |
478 DISALLOW_COPY_AND_ASSIGN(SessionService); | 478 DISALLOW_COPY_AND_ASSIGN(SessionService); |
479 }; | 479 }; |
480 | 480 |
481 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 481 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
OLD | NEW |