| 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_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 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/callback_list.h" | 12 #include "base/callback_list.h" |
| 13 #include "base/macros.h" |
| 12 #include "chrome/browser/ui/host_desktop.h" | 14 #include "chrome/browser/ui/host_desktop.h" |
| 13 #include "components/history/core/browser/history_service.h" | 15 #include "components/history/core/browser/history_service.h" |
| 14 #include "components/sessions/core/session_types.h" | 16 #include "components/sessions/core/session_types.h" |
| 15 #include "ui/base/window_open_disposition.h" | 17 #include "ui/base/window_open_disposition.h" |
| 16 | 18 |
| 17 class Browser; | 19 class Browser; |
| 18 class Profile; | 20 class Profile; |
| 19 | 21 |
| 20 namespace content { | 22 namespace content { |
| 21 class WebContents; | 23 class WebContents; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // for details. If |browser| is non-null the tabs for the first window are | 59 // for details. If |browser| is non-null the tabs for the first window are |
| 58 // added to it. Returns the last active browser. | 60 // added to it. Returns the last active browser. |
| 59 // Every additional browser created will be created on the desktop specified | 61 // Every additional browser created will be created on the desktop specified |
| 60 // by |host_desktop_type|, if |browser| is non-null it should have the same | 62 // by |host_desktop_type|, if |browser| is non-null it should have the same |
| 61 // desktop type. | 63 // desktop type. |
| 62 // | 64 // |
| 63 // If |urls_to_open| is non-empty, a tab is added for each of the URLs. | 65 // If |urls_to_open| is non-empty, a tab is added for each of the URLs. |
| 64 static Browser* RestoreSession(Profile* profile, | 66 static Browser* RestoreSession(Profile* profile, |
| 65 Browser* browser, | 67 Browser* browser, |
| 66 chrome::HostDesktopType host_desktop_type, | 68 chrome::HostDesktopType host_desktop_type, |
| 67 uint32 behavior, | 69 uint32_t behavior, |
| 68 const std::vector<GURL>& urls_to_open); | 70 const std::vector<GURL>& urls_to_open); |
| 69 | 71 |
| 70 // Restores the last session when the last session crashed. It's a wrapper | 72 // Restores the last session when the last session crashed. It's a wrapper |
| 71 // of function RestoreSession. | 73 // of function RestoreSession. |
| 72 static void RestoreSessionAfterCrash(Browser* browser); | 74 static void RestoreSessionAfterCrash(Browser* browser); |
| 73 | 75 |
| 74 // Specifically used in the restoration of a foreign session. This function | 76 // Specifically used in the restoration of a foreign session. This function |
| 75 // restores the given session windows to multiple browsers all of which | 77 // restores the given session windows to multiple browsers all of which |
| 76 // will be created on the desktop specified by |host_desktop_type|. Returns | 78 // will be created on the desktop specified by |host_desktop_type|. Returns |
| 77 // the created Browsers. | 79 // the created Browsers. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return on_session_restored_callbacks_; | 121 return on_session_restored_callbacks_; |
| 120 } | 122 } |
| 121 | 123 |
| 122 // Contains all registered callbacks for session restore notifications. | 124 // Contains all registered callbacks for session restore notifications. |
| 123 static CallbackList* on_session_restored_callbacks_; | 125 static CallbackList* on_session_restored_callbacks_; |
| 124 | 126 |
| 125 DISALLOW_COPY_AND_ASSIGN(SessionRestore); | 127 DISALLOW_COPY_AND_ASSIGN(SessionRestore); |
| 126 }; | 128 }; |
| 127 | 129 |
| 128 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ | 130 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ |
| OLD | NEW |