| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Sets the user agent override of the specified tab. | 194 // Sets the user agent override of the specified tab. |
| 195 void SetTabUserAgentOverride(const SessionID& window_id, | 195 void SetTabUserAgentOverride(const SessionID& window_id, |
| 196 const SessionID& tab_id, | 196 const SessionID& tab_id, |
| 197 const std::string& user_agent_override); | 197 const std::string& user_agent_override); |
| 198 | 198 |
| 199 // Sets the application extension id of the specified tab. | 199 // Sets the application extension id of the specified tab. |
| 200 void SetTabExtensionAppID(const SessionID& window_id, | 200 void SetTabExtensionAppID(const SessionID& window_id, |
| 201 const SessionID& tab_id, | 201 const SessionID& tab_id, |
| 202 const std::string& extension_app_id); | 202 const std::string& extension_app_id); |
| 203 | 203 |
| 204 // Sets the last active time of the tab. |
| 205 void SetLastActiveTime(const SessionID& window_id, |
| 206 const SessionID& tab_id, |
| 207 base::TimeTicks last_active_time); |
| 208 |
| 204 // Callback from GetLastSession. | 209 // Callback from GetLastSession. |
| 205 // The second parameter is the id of the window that was last active. | 210 // The second parameter is the id of the window that was last active. |
| 206 typedef base::Callback<void(ScopedVector<sessions::SessionWindow>, | 211 typedef base::Callback<void(ScopedVector<sessions::SessionWindow>, |
| 207 SessionID::id_type)> SessionCallback; | 212 SessionID::id_type)> SessionCallback; |
| 208 | 213 |
| 209 // Fetches the contents of the last session, notifying the callback when | 214 // Fetches the contents of the last session, notifying the callback when |
| 210 // done. If the callback is supplied an empty vector of SessionWindows | 215 // done. If the callback is supplied an empty vector of SessionWindows |
| 211 // it means the session could not be restored. | 216 // it means the session could not be restored. |
| 212 base::CancelableTaskTracker::TaskId GetLastSession( | 217 base::CancelableTaskTracker::TaskId GetLastSession( |
| 213 const SessionCallback& callback, | 218 const SessionCallback& callback, |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // For browser_tests, since we want to simulate the browser shutting down | 396 // For browser_tests, since we want to simulate the browser shutting down |
| 392 // without quitting. | 397 // without quitting. |
| 393 bool force_browser_not_alive_with_no_windows_; | 398 bool force_browser_not_alive_with_no_windows_; |
| 394 | 399 |
| 395 base::WeakPtrFactory<SessionService> weak_factory_; | 400 base::WeakPtrFactory<SessionService> weak_factory_; |
| 396 | 401 |
| 397 DISALLOW_COPY_AND_ASSIGN(SessionService); | 402 DISALLOW_COPY_AND_ASSIGN(SessionService); |
| 398 }; | 403 }; |
| 399 | 404 |
| 400 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 405 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
| OLD | NEW |