OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "chrome/browser/defaults.h" | 15 #include "chrome/browser/defaults.h" |
16 #include "chrome/browser/sessions/base_session_service.h" | 16 #include "chrome/browser/sessions/base_session_service.h" |
17 #include "chrome/browser/sessions/session_id.h" | 17 #include "chrome/browser/sessions/session_id.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_list.h" |
20 #include "content/common/notification_observer.h" | 20 #include "content/common/notification_observer.h" |
21 #include "content/common/notification_registrar.h" | 21 #include "content/common/notification_registrar.h" |
| 22 #include "ui/base/ui_base_types.h" |
22 | 23 |
23 class NavigationEntry; | 24 class NavigationEntry; |
24 class Profile; | 25 class Profile; |
25 class SessionCommand; | 26 class SessionCommand; |
26 struct SessionTab; | 27 struct SessionTab; |
27 struct SessionWindow; | 28 struct SessionWindow; |
28 class TabContentsWrapper; | 29 class TabContentsWrapper; |
29 | 30 |
30 // SessionService ------------------------------------------------------------ | 31 // SessionService ------------------------------------------------------------ |
31 | 32 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // browsers are running. | 75 // browsers are running. |
75 void MoveCurrentSessionToLastSession(); | 76 void MoveCurrentSessionToLastSession(); |
76 | 77 |
77 // Associates a tab with a window. | 78 // Associates a tab with a window. |
78 void SetTabWindow(const SessionID& window_id, | 79 void SetTabWindow(const SessionID& window_id, |
79 const SessionID& tab_id); | 80 const SessionID& tab_id); |
80 | 81 |
81 // Sets the bounds of a window. | 82 // Sets the bounds of a window. |
82 void SetWindowBounds(const SessionID& window_id, | 83 void SetWindowBounds(const SessionID& window_id, |
83 const gfx::Rect& bounds, | 84 const gfx::Rect& bounds, |
84 bool is_maximized); | 85 ui::WindowShowState show_state); |
85 | 86 |
86 // Sets the visual index of the tab in its parent window. | 87 // Sets the visual index of the tab in its parent window. |
87 void SetTabIndexInWindow(const SessionID& window_id, | 88 void SetTabIndexInWindow(const SessionID& window_id, |
88 const SessionID& tab_id, | 89 const SessionID& tab_id, |
89 int new_index); | 90 int new_index); |
90 | 91 |
91 // Sets the pinned state of the tab. | 92 // Sets the pinned state of the tab. |
92 void SetPinnedState(const SessionID& window_id, | 93 void SetPinnedState(const SessionID& window_id, |
93 const SessionID& tab_id, | 94 const SessionID& tab_id, |
94 bool is_pinned); | 95 bool is_pinned); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // Methods to create the various commands. It is up to the caller to delete | 212 // Methods to create the various commands. It is up to the caller to delete |
212 // the returned the SessionCommand* object. | 213 // the returned the SessionCommand* object. |
213 SessionCommand* CreateSetSelectedTabInWindow(const SessionID& window_id, | 214 SessionCommand* CreateSetSelectedTabInWindow(const SessionID& window_id, |
214 int index); | 215 int index); |
215 | 216 |
216 SessionCommand* CreateSetTabWindowCommand(const SessionID& window_id, | 217 SessionCommand* CreateSetTabWindowCommand(const SessionID& window_id, |
217 const SessionID& tab_id); | 218 const SessionID& tab_id); |
218 | 219 |
219 SessionCommand* CreateSetWindowBoundsCommand(const SessionID& window_id, | 220 SessionCommand* CreateSetWindowBoundsCommand(const SessionID& window_id, |
220 const gfx::Rect& bounds, | 221 const gfx::Rect& bounds, |
221 bool is_maximized); | 222 ui::WindowShowState show_state); |
222 | 223 |
223 SessionCommand* CreateSetTabIndexInWindowCommand(const SessionID& tab_id, | 224 SessionCommand* CreateSetTabIndexInWindowCommand(const SessionID& tab_id, |
224 int new_index); | 225 int new_index); |
225 | 226 |
226 SessionCommand* CreateTabClosedCommand(SessionID::id_type tab_id); | 227 SessionCommand* CreateTabClosedCommand(SessionID::id_type tab_id); |
227 | 228 |
228 SessionCommand* CreateWindowClosedCommand(SessionID::id_type tab_id); | 229 SessionCommand* CreateWindowClosedCommand(SessionID::id_type tab_id); |
229 | 230 |
230 SessionCommand* CreateSetSelectedNavigationIndexCommand( | 231 SessionCommand* CreateSetSelectedNavigationIndexCommand( |
231 const SessionID& tab_id, | 232 const SessionID& tab_id, |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 446 |
446 // Constants used in calculating histogram data. | 447 // Constants used in calculating histogram data. |
447 const base::TimeDelta save_delay_in_millis_; | 448 const base::TimeDelta save_delay_in_millis_; |
448 const base::TimeDelta save_delay_in_mins_; | 449 const base::TimeDelta save_delay_in_mins_; |
449 const base::TimeDelta save_delay_in_hrs_; | 450 const base::TimeDelta save_delay_in_hrs_; |
450 | 451 |
451 DISALLOW_COPY_AND_ASSIGN(SessionService); | 452 DISALLOW_COPY_AND_ASSIGN(SessionService); |
452 }; | 453 }; |
453 | 454 |
454 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 455 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
OLD | NEW |