| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sessions/session_service.h" | 7 #include "chrome/browser/sessions/session_service.h" |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // Every kWritesPerReset commands triggers recreating the file. | 53 // Every kWritesPerReset commands triggers recreating the file. |
| 54 static const int kWritesPerReset = 250; | 54 static const int kWritesPerReset = 250; |
| 55 | 55 |
| 56 namespace { | 56 namespace { |
| 57 | 57 |
| 58 // The callback from GetLastSession is internally routed to SessionService | 58 // The callback from GetLastSession is internally routed to SessionService |
| 59 // first and then the caller. This is done so that the SessionWindows can be | 59 // first and then the caller. This is done so that the SessionWindows can be |
| 60 // recreated from the SessionCommands and the SessionWindows passed to the | 60 // recreated from the SessionCommands and the SessionWindows passed to the |
| 61 // caller. The following class is used for this. | 61 // caller. The following class is used for this. |
| 62 class InternalLastSessionRequest : | 62 class InternalLastSessionRequest |
| 63 public BaseSessionService::InternalGetCommandsRequest { | 63 : public BaseSessionService::InternalGetCommandsRequest { |
| 64 public: | 64 public: |
| 65 InternalLastSessionRequest( | 65 InternalLastSessionRequest( |
| 66 CallbackType* callback, | 66 CallbackType* callback, |
| 67 SessionService::LastSessionCallback* real_callback) | 67 SessionService::LastSessionCallback* real_callback) |
| 68 : BaseSessionService::InternalGetCommandsRequest(callback), | 68 : BaseSessionService::InternalGetCommandsRequest(callback), |
| 69 real_callback(real_callback) { | 69 real_callback(real_callback) { |
| 70 } | 70 } |
| 71 | 71 |
| 72 // The callback supplied to GetLastSession. | 72 // The callback supplied to GetLastSession. |
| 73 scoped_ptr<SessionService::LastSessionCallback> real_callback; | 73 scoped_ptr<SessionService::LastSessionCallback> real_callback; |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 browser->profile()->GetOriginalProfile() == profile()) { | 1145 browser->profile()->GetOriginalProfile() == profile()) { |
| 1146 return true; | 1146 return true; |
| 1147 } | 1147 } |
| 1148 } | 1148 } |
| 1149 return false; | 1149 return false; |
| 1150 } | 1150 } |
| 1151 | 1151 |
| 1152 bool SessionService::ShouldTrackChangesToWindow(const SessionID& window_id) { | 1152 bool SessionService::ShouldTrackChangesToWindow(const SessionID& window_id) { |
| 1153 return windows_tracking_.find(window_id.id()) != windows_tracking_.end(); | 1153 return windows_tracking_.find(window_id.id()) != windows_tracking_.end(); |
| 1154 } | 1154 } |
| OLD | NEW |