| 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_BASE_SESSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "chrome/browser/common/cancelable_request.h" | 15 #include "chrome/browser/common/cancelable_request.h" |
| 16 #include "chrome/browser/profiles/profile_keyed_service.h" | |
| 17 #include "chrome/browser/sessions/session_id.h" | 16 #include "chrome/browser/sessions/session_id.h" |
| 18 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 19 | 18 |
| 20 class Profile; | 19 class Profile; |
| 21 class SessionBackend; | 20 class SessionBackend; |
| 22 class SessionCommand; | 21 class SessionCommand; |
| 23 class TabNavigation; | 22 class TabNavigation; |
| 24 | 23 |
| 25 // BaseSessionService is the super class of both tab restore service and | 24 // BaseSessionService is the super class of both tab restore service and |
| 26 // session service. It contains commonality needed by both, in particular | 25 // session service. It contains commonality needed by both, in particular |
| 27 // it manages a set of SessionCommands that are periodically sent to a | 26 // it manages a set of SessionCommands that are periodically sent to a |
| 28 // SessionBackend. | 27 // SessionBackend. |
| 29 class BaseSessionService : public CancelableRequestProvider, | 28 class BaseSessionService : public CancelableRequestProvider { |
| 30 public ProfileKeyedService { | |
| 31 public: | 29 public: |
| 32 // Identifies the type of session service this is. This is used by the | 30 // Identifies the type of session service this is. This is used by the |
| 33 // backend to determine the name of the files. | 31 // backend to determine the name of the files. |
| 34 enum SessionType { | 32 enum SessionType { |
| 35 SESSION_RESTORE, | 33 SESSION_RESTORE, |
| 36 TAB_RESTORE | 34 TAB_RESTORE |
| 37 }; | 35 }; |
| 38 | 36 |
| 39 // Creates a new BaseSessionService. After creation you need to invoke | 37 // Creates a new BaseSessionService. After creation you need to invoke |
| 40 // Init. | 38 // Init. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // over the commands. | 196 // over the commands. |
| 199 bool pending_reset_; | 197 bool pending_reset_; |
| 200 | 198 |
| 201 // The number of commands sent to the backend before doing a reset. | 199 // The number of commands sent to the backend before doing a reset. |
| 202 int commands_since_reset_; | 200 int commands_since_reset_; |
| 203 | 201 |
| 204 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 202 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
| 205 }; | 203 }; |
| 206 | 204 |
| 207 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 205 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
| OLD | NEW |