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 10 matching lines...) Expand all Loading... |
21 #include "ui/base/ui_base_types.h" | 21 #include "ui/base/ui_base_types.h" |
22 | 22 |
23 class Profile; | 23 class Profile; |
24 class SessionCommand; | 24 class SessionCommand; |
25 class TabContents; | 25 class TabContents; |
26 struct SessionTab; | 26 struct SessionTab; |
27 struct SessionWindow; | 27 struct SessionWindow; |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 class NavigationEntry; | 30 class NavigationEntry; |
| 31 class WebContents; |
31 } | 32 } |
32 | 33 |
33 // SessionService ------------------------------------------------------------ | 34 // SessionService ------------------------------------------------------------ |
34 | 35 |
35 // SessionService is responsible for maintaining the state of open windows | 36 // SessionService is responsible for maintaining the state of open windows |
36 // and tabs so that they can be restored at a later date. The state of the | 37 // and tabs so that they can be restored at a later date. The state of the |
37 // currently open browsers is referred to as the current session. | 38 // currently open browsers is referred to as the current session. |
38 // | 39 // |
39 // SessionService supports restoring from the last session. The last session | 40 // SessionService supports restoring from the last session. The last session |
40 // typically corresponds to the last run of the browser, but not always. For | 41 // typically corresponds to the last run of the browser, but not always. For |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void TabClosed(const SessionID& window_id, | 117 void TabClosed(const SessionID& window_id, |
117 const SessionID& tab_id, | 118 const SessionID& tab_id, |
118 bool closed_by_user_gesture); | 119 bool closed_by_user_gesture); |
119 | 120 |
120 // Notification the window is about to close. | 121 // Notification the window is about to close. |
121 void WindowClosing(const SessionID& window_id); | 122 void WindowClosing(const SessionID& window_id); |
122 | 123 |
123 // Notification a window has finished closing. | 124 // Notification a window has finished closing. |
124 void WindowClosed(const SessionID& window_id); | 125 void WindowClosed(const SessionID& window_id); |
125 | 126 |
| 127 // Called when a tab is inserted. |
| 128 void TabInserted(content::WebContents* contents); |
| 129 |
| 130 // Called when a tab is closing. |
| 131 void TabClosing(content::WebContents* contents); |
| 132 |
126 // Sets the type of window. In order for the contents of a window to be | 133 // Sets the type of window. In order for the contents of a window to be |
127 // tracked SetWindowType must be invoked with a type we track | 134 // tracked SetWindowType must be invoked with a type we track |
128 // (should_track_changes_for_browser_type returns true). | 135 // (should_track_changes_for_browser_type returns true). |
129 void SetWindowType(const SessionID& window_id, | 136 void SetWindowType(const SessionID& window_id, |
130 Browser::Type type, | 137 Browser::Type type, |
131 AppType app_type); | 138 AppType app_type); |
132 | 139 |
133 // Sets the application name of the specified window. | 140 // Sets the application name of the specified window. |
134 void SetWindowAppName(const SessionID& window_id, | 141 void SetWindowAppName(const SessionID& window_id, |
135 const std::string& app_name); | 142 const std::string& app_name); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 const base::TimeDelta save_delay_in_hrs_; | 478 const base::TimeDelta save_delay_in_hrs_; |
472 | 479 |
473 // For browser_tests, since we want to simulate the browser shutting down | 480 // For browser_tests, since we want to simulate the browser shutting down |
474 // without quitting. | 481 // without quitting. |
475 bool force_browser_not_alive_with_no_windows_; | 482 bool force_browser_not_alive_with_no_windows_; |
476 | 483 |
477 DISALLOW_COPY_AND_ASSIGN(SessionService); | 484 DISALLOW_COPY_AND_ASSIGN(SessionService); |
478 }; | 485 }; |
479 | 486 |
480 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 487 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
OLD | NEW |