| 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 #include "chrome/browser/sessions/session_service.h" | 5 #include "chrome/browser/sessions/session_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 } | 707 } |
| 708 | 708 |
| 709 void SessionService::OnBrowserSetLastActive(Browser* browser) { | 709 void SessionService::OnBrowserSetLastActive(Browser* browser) { |
| 710 if (ShouldTrackBrowser(browser)) | 710 if (ShouldTrackBrowser(browser)) |
| 711 ScheduleCommand( | 711 ScheduleCommand( |
| 712 sessions::CreateSetActiveWindowCommand(browser->session_id())); | 712 sessions::CreateSetActiveWindowCommand(browser->session_id())); |
| 713 } | 713 } |
| 714 | 714 |
| 715 void SessionService::OnGotSessionCommands( | 715 void SessionService::OnGotSessionCommands( |
| 716 const sessions::GetLastSessionCallback& callback, | 716 const sessions::GetLastSessionCallback& callback, |
| 717 ScopedVector<sessions::SessionCommand> commands) { | 717 std::vector<std::unique_ptr<sessions::SessionCommand>> commands) { |
| 718 std::vector<std::unique_ptr<sessions::SessionWindow>> valid_windows; | 718 std::vector<std::unique_ptr<sessions::SessionWindow>> valid_windows; |
| 719 SessionID::id_type active_window_id = 0; | 719 SessionID::id_type active_window_id = 0; |
| 720 | 720 |
| 721 sessions::RestoreSessionFromCommands(commands, &valid_windows, | 721 sessions::RestoreSessionFromCommands(commands, &valid_windows, |
| 722 &active_window_id); | 722 &active_window_id); |
| 723 RemoveUnusedRestoreWindows(&valid_windows); | 723 RemoveUnusedRestoreWindows(&valid_windows); |
| 724 | 724 |
| 725 callback.Run(std::move(valid_windows), active_window_id); | 725 callback.Run(std::move(valid_windows), active_window_id); |
| 726 } | 726 } |
| 727 | 727 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 for (auto* browser : *BrowserList::GetInstance()) { | 1100 for (auto* browser : *BrowserList::GetInstance()) { |
| 1101 if (browser->profile() == profile()) | 1101 if (browser->profile() == profile()) |
| 1102 return; | 1102 return; |
| 1103 } | 1103 } |
| 1104 DeleteSessionOnlyData(profile()); | 1104 DeleteSessionOnlyData(profile()); |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 sessions::BaseSessionService* SessionService::GetBaseSessionServiceForTest() { | 1107 sessions::BaseSessionService* SessionService::GetBaseSessionServiceForTest() { |
| 1108 return base_session_service_.get(); | 1108 return base_session_service_.get(); |
| 1109 } | 1109 } |
| OLD | NEW |