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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 // Returns true if synchronously restoring a session. | 94 // Returns true if synchronously restoring a session. |
| 95 static bool IsRestoringSynchronously(); | 95 static bool IsRestoringSynchronously(); |
| 96 | 96 |
| 97 // Registers a callback that is notified every time session restore completes. | 97 // Registers a callback that is notified every time session restore completes. |
| 98 // Note that 'complete' means all the browsers and tabs have been created but | 98 // Note that 'complete' means all the browsers and tabs have been created but |
| 99 // have not necessarily finished loading. The integer supplied to the callback | 99 // have not necessarily finished loading. The integer supplied to the callback |
| 100 // indicates the number of tabs that were created. | 100 // indicates the number of tabs that were created. |
| 101 static CallbackSubscription RegisterOnSessionRestoredCallback( | 101 static CallbackSubscription RegisterOnSessionRestoredCallback( |
| 102 const base::Callback<void(int)>& callback); | 102 const base::Callback<void(int)>& callback); |
| 103 | 103 |
| 104 static void AddURLsToOpen(const Profile* profile, | |
|
sky
2017/04/28 17:34:58
Add description.
eugenebng
2017/05/03 16:05:30
Done.
| |
| 105 const std::vector<GURL> urls); | |
|
sky
2017/04/28 17:34:59
const std::vector<GURL>&
eugenebng
2017/05/03 16:05:30
Done.
| |
| 106 | |
| 104 private: | 107 private: |
| 105 SessionRestore(); | 108 SessionRestore(); |
| 106 | 109 |
| 107 // Accessor for |*on_session_restored_callbacks_|. Creates a new object the | 110 // Accessor for |*on_session_restored_callbacks_|. Creates a new object the |
| 108 // first time so that it always returns a valid object. | 111 // first time so that it always returns a valid object. |
| 109 static CallbackList* on_session_restored_callbacks() { | 112 static CallbackList* on_session_restored_callbacks() { |
| 110 if (!on_session_restored_callbacks_) | 113 if (!on_session_restored_callbacks_) |
| 111 on_session_restored_callbacks_ = new CallbackList(); | 114 on_session_restored_callbacks_ = new CallbackList(); |
| 112 return on_session_restored_callbacks_; | 115 return on_session_restored_callbacks_; |
| 113 } | 116 } |
| 114 | 117 |
| 115 // Contains all registered callbacks for session restore notifications. | 118 // Contains all registered callbacks for session restore notifications. |
| 116 static CallbackList* on_session_restored_callbacks_; | 119 static CallbackList* on_session_restored_callbacks_; |
| 117 | 120 |
| 118 DISALLOW_COPY_AND_ASSIGN(SessionRestore); | 121 DISALLOW_COPY_AND_ASSIGN(SessionRestore); |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ | 124 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_H_ |
| OLD | NEW |