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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 SessionCommand* CreateSetSelectedNavigationIndexCommand( | 248 SessionCommand* CreateSetSelectedNavigationIndexCommand( |
249 const SessionID& tab_id, | 249 const SessionID& tab_id, |
250 int index); | 250 int index); |
251 | 251 |
252 SessionCommand* CreateSetWindowTypeCommand(const SessionID& window_id, | 252 SessionCommand* CreateSetWindowTypeCommand(const SessionID& window_id, |
253 WindowType type); | 253 WindowType type); |
254 | 254 |
255 SessionCommand* CreatePinnedStateCommand(const SessionID& tab_id, | 255 SessionCommand* CreatePinnedStateCommand(const SessionID& tab_id, |
256 bool is_pinned); | 256 bool is_pinned); |
257 | 257 |
| 258 void CreateAndScheduleSessionStorageAssociatedCommand(int64 id, |
| 259 int64 real_id); |
| 260 |
258 // Callback from the backend for getting the commands from the save file. | 261 // Callback from the backend for getting the commands from the save file. |
259 // Converts the commands in SessionWindows and notifies the real callback. | 262 // Converts the commands in SessionWindows and notifies the real callback. |
260 void OnGotSessionCommands( | 263 void OnGotSessionCommands( |
261 Handle handle, | 264 Handle handle, |
262 scoped_refptr<InternalGetCommandsRequest> request); | 265 scoped_refptr<InternalGetCommandsRequest> request); |
263 | 266 |
264 // Converts the commands into SessionWindows. On return any valid | 267 // Converts the commands into SessionWindows. On return any valid |
265 // windows are added to valid_windows. It is up to the caller to delete | 268 // windows are added to valid_windows. It is up to the caller to delete |
266 // the windows added to valid_windows. | 269 // the windows added to valid_windows. |
267 // | 270 // |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 469 |
467 // Constants used in calculating histogram data. | 470 // Constants used in calculating histogram data. |
468 const base::TimeDelta save_delay_in_millis_; | 471 const base::TimeDelta save_delay_in_millis_; |
469 const base::TimeDelta save_delay_in_mins_; | 472 const base::TimeDelta save_delay_in_mins_; |
470 const base::TimeDelta save_delay_in_hrs_; | 473 const base::TimeDelta save_delay_in_hrs_; |
471 | 474 |
472 // For browser_tests, since we want to simulate the browser shutting down | 475 // For browser_tests, since we want to simulate the browser shutting down |
473 // without quitting. | 476 // without quitting. |
474 bool force_browser_not_alive_with_no_windows_; | 477 bool force_browser_not_alive_with_no_windows_; |
475 | 478 |
| 479 // Map from session storage namespace id (stored by |SessionStorageNamespace|) |
| 480 // to a pair (window_id, tab_id). |
| 481 typedef std::map<int64, |
| 482 std::pair<SessionID, SessionID> > SessionStorageIdToTab; |
| 483 SessionStorageIdToTab session_storage_id_to_tab_; |
| 484 |
476 DISALLOW_COPY_AND_ASSIGN(SessionService); | 485 DISALLOW_COPY_AND_ASSIGN(SessionService); |
477 }; | 486 }; |
478 | 487 |
479 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 488 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
OLD | NEW |