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_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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // with incognito windows. | 45 // with incognito windows. |
46 // | 46 // |
47 // SessionService itself maintains a set of SessionCommands that allow | 47 // SessionService itself maintains a set of SessionCommands that allow |
48 // SessionService to rebuild the open state of the browser (as | 48 // SessionService to rebuild the open state of the browser (as |
49 // SessionWindow, SessionTab and TabNavigation). The commands are periodically | 49 // SessionWindow, SessionTab and TabNavigation). The commands are periodically |
50 // flushed to SessionBackend and written to a file. Every so often | 50 // flushed to SessionBackend and written to a file. Every so often |
51 // SessionService rebuilds the contents of the file from the open state | 51 // SessionService rebuilds the contents of the file from the open state |
52 // of the browser. | 52 // of the browser. |
53 class SessionService : public BaseSessionService, | 53 class SessionService : public BaseSessionService, |
54 public content::NotificationObserver { | 54 public content::NotificationObserver { |
55 friend class SessionRestoreTest; | |
56 friend class SessionServiceTestHelper; | 55 friend class SessionServiceTestHelper; |
57 public: | 56 public: |
58 // Used to distinguish an application window from a normal one. | 57 // Used to distinguish an application window from a normal one. |
59 enum AppType { | 58 enum AppType { |
60 TYPE_APP, | 59 TYPE_APP, |
61 TYPE_NORMAL | 60 TYPE_NORMAL |
62 }; | 61 }; |
63 | 62 |
64 // Creates a SessionService for the specified profile. | 63 // Creates a SessionService for the specified profile. |
65 explicit SessionService(Profile* profile); | 64 explicit SessionService(Profile* profile); |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 const base::TimeDelta save_delay_in_hrs_; | 472 const base::TimeDelta save_delay_in_hrs_; |
474 | 473 |
475 // For browser_tests, since we want to simulate the browser shutting down | 474 // For browser_tests, since we want to simulate the browser shutting down |
476 // without quitting. | 475 // without quitting. |
477 bool force_browser_not_alive_with_no_windows_; | 476 bool force_browser_not_alive_with_no_windows_; |
478 | 477 |
479 DISALLOW_COPY_AND_ASSIGN(SessionService); | 478 DISALLOW_COPY_AND_ASSIGN(SessionService); |
480 }; | 479 }; |
481 | 480 |
482 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 481 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
OLD | NEW |