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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 Browser* browser) { | 556 Browser* browser) { |
557 if (ShouldNewWindowStartSession()) { | 557 if (ShouldNewWindowStartSession()) { |
558 // We're going from no tabbed browsers to a tabbed browser (and not in | 558 // We're going from no tabbed browsers to a tabbed browser (and not in |
559 // process startup), restore the last session. | 559 // process startup), restore the last session. |
560 if (move_on_new_browser_) { | 560 if (move_on_new_browser_) { |
561 // Make the current session the last. | 561 // Make the current session the last. |
562 MoveCurrentSessionToLastSession(); | 562 MoveCurrentSessionToLastSession(); |
563 move_on_new_browser_ = false; | 563 move_on_new_browser_ = false; |
564 } | 564 } |
565 SessionStartupPref pref = StartupBrowserCreator::GetSessionStartupPref( | 565 SessionStartupPref pref = StartupBrowserCreator::GetSessionStartupPref( |
566 *CommandLine::ForCurrentProcess(), profile()); | 566 *base::CommandLine::ForCurrentProcess(), profile()); |
567 if (pref.type == SessionStartupPref::LAST) { | 567 if (pref.type == SessionStartupPref::LAST) { |
568 SessionRestore::RestoreSession( | 568 SessionRestore::RestoreSession( |
569 profile(), browser, | 569 profile(), browser, |
570 browser ? browser->host_desktop_type() : chrome::GetActiveDesktop(), | 570 browser ? browser->host_desktop_type() : chrome::GetActiveDesktop(), |
571 browser ? 0 : SessionRestore::ALWAYS_CREATE_TABBED_BROWSER, | 571 browser ? 0 : SessionRestore::ALWAYS_CREATE_TABBED_BROWSER, |
572 urls_to_open); | 572 urls_to_open); |
573 return true; | 573 return true; |
574 } | 574 } |
575 } | 575 } |
576 return false; | 576 return false; |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 1093 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
1094 if ((*it)->profile() == profile()) | 1094 if ((*it)->profile() == profile()) |
1095 return; | 1095 return; |
1096 } | 1096 } |
1097 DeleteSessionOnlyData(profile()); | 1097 DeleteSessionOnlyData(profile()); |
1098 } | 1098 } |
1099 | 1099 |
1100 sessions::BaseSessionService* SessionService::GetBaseSessionServiceForTest() { | 1100 sessions::BaseSessionService* SessionService::GetBaseSessionServiceForTest() { |
1101 return base_session_service_.get(); | 1101 return base_session_service_.get(); |
1102 } | 1102 } |
OLD | NEW |