| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 move_on_new_browser_(false), | 196 move_on_new_browser_(false), |
| 197 save_delay_in_millis_(base::TimeDelta::FromMilliseconds(2500)), | 197 save_delay_in_millis_(base::TimeDelta::FromMilliseconds(2500)), |
| 198 save_delay_in_mins_(base::TimeDelta::FromMinutes(10)), | 198 save_delay_in_mins_(base::TimeDelta::FromMinutes(10)), |
| 199 save_delay_in_hrs_(base::TimeDelta::FromHours(8)), | 199 save_delay_in_hrs_(base::TimeDelta::FromHours(8)), |
| 200 force_browser_not_alive_with_no_windows_(false) { | 200 force_browser_not_alive_with_no_windows_(false) { |
| 201 Init(); | 201 Init(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 SessionService::~SessionService() { | 204 SessionService::~SessionService() { |
| 205 // The BrowserList should outlive the SessionService since it's static and | 205 // The BrowserList should outlive the SessionService since it's static and |
| 206 // the SessionService is a ProfileKeyedService. | 206 // the SessionService is a BrowserContextKeyedService. |
| 207 BrowserList::RemoveObserver(this); | 207 BrowserList::RemoveObserver(this); |
| 208 Save(); | 208 Save(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 bool SessionService::RestoreIfNecessary(const std::vector<GURL>& urls_to_open) { | 211 bool SessionService::RestoreIfNecessary(const std::vector<GURL>& urls_to_open) { |
| 212 return RestoreIfNecessary(urls_to_open, NULL); | 212 return RestoreIfNecessary(urls_to_open, NULL); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void SessionService::ResetFromCurrentBrowsers() { | 215 void SessionService::ResetFromCurrentBrowsers() { |
| 216 ScheduleReset(); | 216 ScheduleReset(); |
| (...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1755 contents->GetController().GetDefaultSessionStorageNamespace(); | 1755 contents->GetController().GetDefaultSessionStorageNamespace(); |
| 1756 session_storage_namespace->SetShouldPersist(false); | 1756 session_storage_namespace->SetShouldPersist(false); |
| 1757 SessionTabHelper* session_tab_helper = | 1757 SessionTabHelper* session_tab_helper = |
| 1758 SessionTabHelper::FromWebContents(contents); | 1758 SessionTabHelper::FromWebContents(contents); |
| 1759 TabClosed(session_tab_helper->window_id(), | 1759 TabClosed(session_tab_helper->window_id(), |
| 1760 session_tab_helper->session_id(), | 1760 session_tab_helper->session_id(), |
| 1761 contents->GetClosedByUserGesture()); | 1761 contents->GetClosedByUserGesture()); |
| 1762 RecordSessionUpdateHistogramData(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 1762 RecordSessionUpdateHistogramData(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 1763 &last_updated_tab_closed_time_); | 1763 &last_updated_tab_closed_time_); |
| 1764 } | 1764 } |
| OLD | NEW |