Chromium Code Reviews| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 // by |host_desktop_type|, if |browser| is non-null it should have the same | 45 // by |host_desktop_type|, if |browser| is non-null it should have the same |
| 46 // desktop type. | 46 // desktop type. |
| 47 // | 47 // |
| 48 // If |urls_to_open| is non-empty, a tab is added for each of the URLs. | 48 // If |urls_to_open| is non-empty, a tab is added for each of the URLs. |
| 49 static Browser* RestoreSession(Profile* profile, | 49 static Browser* RestoreSession(Profile* profile, |
| 50 Browser* browser, | 50 Browser* browser, |
| 51 chrome::HostDesktopType host_desktop_type, | 51 chrome::HostDesktopType host_desktop_type, |
| 52 uint32 behavior, | 52 uint32 behavior, |
| 53 const std::vector<GURL>& urls_to_open); | 53 const std::vector<GURL>& urls_to_open); |
| 54 | 54 |
| 55 // Specifically used in the restoration of a foreign session. This method | 55 // Specifically used in the restoration of a foreign session. This function |
| 56 // restores the given session windows to multiple browsers all of which | 56 // restores the given session windows to multiple browsers all of which |
| 57 // will be created on the desktop specified by |host_desktop_type|. | 57 // will be created on the desktop specified by |host_desktop_type|. The |
| 58 static void RestoreForeignSessionWindows( | 58 // created Browsers are returned to identify the restored Windows. |
|
sky
2013/08/01 00:05:43
You don't need the last part: 'Returns the created
Kristen Dwan
2013/08/02 20:54:19
Done.
| |
| 59 static std::vector<Browser*> RestoreForeignSessionWindows( | |
| 59 Profile* profile, | 60 Profile* profile, |
| 60 chrome::HostDesktopType host_desktop_type, | 61 chrome::HostDesktopType host_desktop_type, |
| 61 std::vector<const SessionWindow*>::const_iterator begin, | 62 std::vector<const SessionWindow*>::const_iterator begin, |
| 62 std::vector<const SessionWindow*>::const_iterator end); | 63 std::vector<const SessionWindow*>::const_iterator end); |
| 63 | 64 |
| 64 // Specifically used in the restoration of a foreign session. This method | 65 // Specifically used in the restoration of a foreign session. This method |
| 65 // restores the given session tab to the browser of |source_web_contents| if | 66 // restores the given session tab to the browser of |source_web_contents| if |
| 66 // the disposition is not NEW_WINDOW. | 67 // the disposition is not NEW_WINDOW. Returns the WebContents corresponding |
| 67 static void RestoreForeignSessionTab( | 68 // to the restored tab. |
| 69 static content::WebContents* RestoreForeignSessionTab( | |
| 68 content::WebContents* source_web_contents, | 70 content::WebContents* source_web_contents, |
| 69 const SessionTab& tab, | 71 const SessionTab& tab, |
| 70 WindowOpenDisposition disposition); | 72 WindowOpenDisposition disposition); |
| 71 | 73 |
| 72 // Returns true if we're in the process of restoring |profile|. | 74 // Returns true if we're in the process of restoring |profile|. |
| 73 static bool IsRestoring(const Profile* profile); | 75 static bool IsRestoring(const Profile* profile); |
| 74 | 76 |
| 75 // Returns true if synchronously restoring a session. | 77 // Returns true if synchronously restoring a session. |
| 76 static bool IsRestoringSynchronously(); | 78 static bool IsRestoringSynchronously(); |
| 77 | 79 |
| 78 // The max number of non-selected tabs SessionRestore loads when restoring | 80 // The max number of non-selected tabs SessionRestore loads when restoring |
| 79 // a session. A value of 0 indicates all tabs are loaded at once. | 81 // a session. A value of 0 indicates all tabs are loaded at once. |
| 80 static size_t num_tabs_to_load_; | 82 static size_t num_tabs_to_load_; |
| 81 | 83 |
| 82 private: | 84 private: |
| 83 SessionRestore(); | 85 SessionRestore(); |
| 84 | 86 |
| 85 DISALLOW_COPY_AND_ASSIGN(SessionRestore); | 87 DISALLOW_COPY_AND_ASSIGN(SessionRestore); |
| 86 }; | 88 }; |
| 87 | 89 |
| 88 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ | 90 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ |
| OLD | NEW |