| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Fetches the contents of the last session, notifying the callback when | 163 // Fetches the contents of the last session, notifying the callback when |
| 164 // done. If the callback is supplied an empty vector of SessionWindows | 164 // done. If the callback is supplied an empty vector of SessionWindows |
| 165 // it means the session could not be restored. | 165 // it means the session could not be restored. |
| 166 // | 166 // |
| 167 // The created request does NOT directly invoke the callback, rather the | 167 // The created request does NOT directly invoke the callback, rather the |
| 168 // callback invokes OnGotSessionCommands from which we map the | 168 // callback invokes OnGotSessionCommands from which we map the |
| 169 // SessionCommands to browser state, then notify the callback. | 169 // SessionCommands to browser state, then notify the callback. |
| 170 Handle GetLastSession(CancelableRequestConsumerBase* consumer, | 170 Handle GetLastSession(CancelableRequestConsumerBase* consumer, |
| 171 const SessionCallback& callback); | 171 const SessionCallback& callback); |
| 172 | 172 |
| 173 // Fetches the contents of the current session, notifying the callback when | |
| 174 // done. If the callback is supplied an empty vector of SessionWindows | |
| 175 // it means the session could not be restored. | |
| 176 // | |
| 177 // The created request does NOT directly invoke the callback, rather the | |
| 178 // callback invokes OnGotSessionCommands from which we map the | |
| 179 // SessionCommands to browser state, then notify the callback. | |
| 180 Handle GetCurrentSession(CancelableRequestConsumerBase* consumer, | |
| 181 const SessionCallback& callback); | |
| 182 | |
| 183 // Overridden from BaseSessionService because we want some UMA reporting on | 173 // Overridden from BaseSessionService because we want some UMA reporting on |
| 184 // session update activities. | 174 // session update activities. |
| 185 virtual void Save() OVERRIDE; | 175 virtual void Save() OVERRIDE; |
| 186 | 176 |
| 187 private: | 177 private: |
| 188 typedef std::map<SessionID::id_type, std::pair<int, int> > IdToRange; | 178 typedef std::map<SessionID::id_type, std::pair<int, int> > IdToRange; |
| 189 typedef std::map<SessionID::id_type, SessionTab*> IdToSessionTab; | 179 typedef std::map<SessionID::id_type, SessionTab*> IdToSessionTab; |
| 190 typedef std::map<SessionID::id_type, SessionWindow*> IdToSessionWindow; | 180 typedef std::map<SessionID::id_type, SessionWindow*> IdToSessionWindow; |
| 191 | 181 |
| 192 | 182 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 442 |
| 453 // Constants used in calculating histogram data. | 443 // Constants used in calculating histogram data. |
| 454 const base::TimeDelta save_delay_in_millis_; | 444 const base::TimeDelta save_delay_in_millis_; |
| 455 const base::TimeDelta save_delay_in_mins_; | 445 const base::TimeDelta save_delay_in_mins_; |
| 456 const base::TimeDelta save_delay_in_hrs_; | 446 const base::TimeDelta save_delay_in_hrs_; |
| 457 | 447 |
| 458 DISALLOW_COPY_AND_ASSIGN(SessionService); | 448 DISALLOW_COPY_AND_ASSIGN(SessionService); |
| 459 }; | 449 }; |
| 460 | 450 |
| 461 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 451 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
| OLD | NEW |