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> |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 private: | 180 private: |
181 typedef std::map<SessionID::id_type, std::pair<int, int> > IdToRange; | 181 typedef std::map<SessionID::id_type, std::pair<int, int> > IdToRange; |
182 typedef std::map<SessionID::id_type, SessionTab*> IdToSessionTab; | 182 typedef std::map<SessionID::id_type, SessionTab*> IdToSessionTab; |
183 typedef std::map<SessionID::id_type, SessionWindow*> IdToSessionWindow; | 183 typedef std::map<SessionID::id_type, SessionWindow*> IdToSessionWindow; |
184 | 184 |
185 | 185 |
186 // These types mirror Browser::Type, but are re-defined here because these | 186 // These types mirror Browser::Type, but are re-defined here because these |
187 // specific enumeration _values_ are written into the session database and | 187 // specific enumeration _values_ are written into the session database and |
188 // are needed to maintain forward compatibility. | 188 // are needed to maintain forward compatibility. |
189 // Note that we only store browsers of type TYPE_TABBED and TYPE_POPUP. | 189 // Note that we only store browsers of type TYPE_TABBED, TYPE_POPUP, |
| 190 // and TYPE_APP. |
190 enum WindowType { | 191 enum WindowType { |
191 TYPE_TABBED = 0, | 192 TYPE_TABBED = 0, |
192 TYPE_POPUP = 1 | 193 TYPE_POPUP = 1, |
| 194 TYPE_APP = 2 |
193 }; | 195 }; |
194 | 196 |
195 void Init(); | 197 void Init(); |
196 | 198 |
197 // Implementation of RestoreIfNecessary. If |browser| is non-null and we need | 199 // Implementation of RestoreIfNecessary. If |browser| is non-null and we need |
198 // to restore, the tabs are added to it, otherwise a new browser is created. | 200 // to restore, the tabs are added to it, otherwise a new browser is created. |
199 bool RestoreIfNecessary(const std::vector<GURL>& urls_to_open, | 201 bool RestoreIfNecessary(const std::vector<GURL>& urls_to_open, |
200 Browser* browser); | 202 Browser* browser); |
201 | 203 |
202 virtual void Observe(int type, | 204 virtual void Observe(int type, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 447 |
446 // Constants used in calculating histogram data. | 448 // Constants used in calculating histogram data. |
447 const base::TimeDelta save_delay_in_millis_; | 449 const base::TimeDelta save_delay_in_millis_; |
448 const base::TimeDelta save_delay_in_mins_; | 450 const base::TimeDelta save_delay_in_mins_; |
449 const base::TimeDelta save_delay_in_hrs_; | 451 const base::TimeDelta save_delay_in_hrs_; |
450 | 452 |
451 DISALLOW_COPY_AND_ASSIGN(SessionService); | 453 DISALLOW_COPY_AND_ASSIGN(SessionService); |
452 }; | 454 }; |
453 | 455 |
454 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 456 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
OLD | NEW |