OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_RESTORE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ |
6 #define CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ | 6 #define CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 // Specifically used in the restoration of a foreign session. This method | 39 // Specifically used in the restoration of a foreign session. This method |
40 // restores the given session windows to a browser. | 40 // restores the given session windows to a browser. |
41 static void RestoreForeignSessionWindows( | 41 static void RestoreForeignSessionWindows( |
42 Profile* profile, | 42 Profile* profile, |
43 std::vector<SessionWindow*>::const_iterator begin, | 43 std::vector<SessionWindow*>::const_iterator begin, |
44 std::vector<SessionWindow*>::const_iterator end); | 44 std::vector<SessionWindow*>::const_iterator end); |
45 | 45 |
46 // Specifically used in the restoration of a foreign session. This method | 46 // Specifically used in the restoration of a foreign session. This method |
47 // restores the given session tab to a browser. | 47 // restores the given session tab to a browser. |
48 static void RestoreForeignSessionTab(Profile* profile, | 48 static void RestoreForeignSessionTab(Profile* profile, |
49 const SessionTab& tab); | 49 const SessionTab& tab); |
50 | 50 |
51 // Synchronously restores the last session. At least one tabbed browser is | 51 // Synchronously restores the last session. At least one tabbed browser is |
52 // created, even if there is an error in restoring. | 52 // created, even if there is an error in restoring. |
53 // | 53 // |
54 // If urls_to_open is non-empty, a tab is added for each of the URLs. | 54 // If urls_to_open is non-empty, a tab is added for each of the URLs. |
55 // | 55 // |
56 // Returns the last active Browser (which may have been created by the act of | 56 // Returns the last active Browser (which may have been created by the act of |
57 // restoring). | 57 // restoring). |
58 static Browser* RestoreSessionSynchronously( | 58 static Browser* RestoreSessionSynchronously( |
59 Profile* profile, | 59 Profile* profile, |
60 const std::vector<GURL>& urls_to_open); | 60 const std::vector<GURL>& urls_to_open); |
61 | 61 |
62 // Returns true if we're in the process of restoring. | 62 // Returns true if we're in the process of restoring. |
63 static bool IsRestoring(); | 63 static bool IsRestoring(); |
64 | 64 |
65 // The max number of non-selected tabs SessionRestore loads when restoring | 65 // The max number of non-selected tabs SessionRestore loads when restoring |
66 // a session. A value of 0 indicates all tabs are loaded at once. | 66 // a session. A value of 0 indicates all tabs are loaded at once. |
67 static size_t num_tabs_to_load_; | 67 static size_t num_tabs_to_load_; |
68 | 68 |
69 private: | 69 private: |
70 SessionRestore(); | 70 SessionRestore(); |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(SessionRestore); | 72 DISALLOW_COPY_AND_ASSIGN(SessionRestore); |
73 }; | 73 }; |
74 | 74 |
75 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ | 75 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ |
OLD | NEW |