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_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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
|
sky
2017/01/03 17:29:34
Remove include?
Avi (use Gerrit)
2017/01/03 17:34:03
Done.
| |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/task/cancelable_task_tracker.h" | 16 #include "base/task/cancelable_task_tracker.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "chrome/browser/defaults.h" | 18 #include "chrome/browser/defaults.h" |
| 19 #include "chrome/browser/sessions/session_common_utils.h" | 19 #include "chrome/browser/sessions/session_common_utils.h" |
| 20 #include "chrome/browser/sessions/session_service_utils.h" | 20 #include "chrome/browser/sessions/session_service_utils.h" |
| 21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/browser/ui/browser_finder.h" | 22 #include "chrome/browser/ui/browser_finder.h" |
| 23 #include "chrome/browser/ui/browser_list_observer.h" | 23 #include "chrome/browser/ui/browser_list_observer.h" |
| 24 #include "components/keyed_service/core/keyed_service.h" | 24 #include "components/keyed_service/core/keyed_service.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 void Observe(int type, | 253 void Observe(int type, |
| 254 const content::NotificationSource& source, | 254 const content::NotificationSource& source, |
| 255 const content::NotificationDetails& details) override; | 255 const content::NotificationDetails& details) override; |
| 256 | 256 |
| 257 // chrome::BrowserListObserver | 257 // chrome::BrowserListObserver |
| 258 void OnBrowserAdded(Browser* browser) override {} | 258 void OnBrowserAdded(Browser* browser) override {} |
| 259 void OnBrowserRemoved(Browser* browser) override {} | 259 void OnBrowserRemoved(Browser* browser) override {} |
| 260 void OnBrowserSetLastActive(Browser* browser) override; | 260 void OnBrowserSetLastActive(Browser* browser) override; |
| 261 | 261 |
| 262 // Converts |commands| to SessionWindows and notifies the callback. | 262 // Converts |commands| to SessionWindows and notifies the callback. |
| 263 void OnGotSessionCommands(const sessions::GetLastSessionCallback& callback, | 263 void OnGotSessionCommands( |
| 264 ScopedVector<sessions::SessionCommand> commands); | 264 const sessions::GetLastSessionCallback& callback, |
| 265 std::vector<std::unique_ptr<sessions::SessionCommand>> commands); | |
| 265 | 266 |
| 266 // Adds commands to commands that will recreate the state of the specified | 267 // Adds commands to commands that will recreate the state of the specified |
| 267 // tab. This adds at most kMaxNavigationCountToPersist navigations (in each | 268 // tab. This adds at most kMaxNavigationCountToPersist navigations (in each |
| 268 // direction from the current navigation index). | 269 // direction from the current navigation index). |
| 269 // A pair is added to tab_to_available_range indicating the range of | 270 // A pair is added to tab_to_available_range indicating the range of |
| 270 // indices that were written. | 271 // indices that were written. |
| 271 void BuildCommandsForTab( | 272 void BuildCommandsForTab( |
| 272 const SessionID& window_id, | 273 const SessionID& window_id, |
| 273 content::WebContents* tab, | 274 content::WebContents* tab, |
| 274 int index_in_window, | 275 int index_in_window, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 // For browser_tests, since we want to simulate the browser shutting down | 402 // For browser_tests, since we want to simulate the browser shutting down |
| 402 // without quitting. | 403 // without quitting. |
| 403 bool force_browser_not_alive_with_no_windows_; | 404 bool force_browser_not_alive_with_no_windows_; |
| 404 | 405 |
| 405 base::WeakPtrFactory<SessionService> weak_factory_; | 406 base::WeakPtrFactory<SessionService> weak_factory_; |
| 406 | 407 |
| 407 DISALLOW_COPY_AND_ASSIGN(SessionService); | 408 DISALLOW_COPY_AND_ASSIGN(SessionService); |
| 408 }; | 409 }; |
| 409 | 410 |
| 410 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ | 411 #endif // CHROME_BROWSER_SESSIONS_SESSION_SERVICE_H_ |
| OLD | NEW |