OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_restore.h" | 5 #include "chrome/browser/sessions/session_restore.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 SessionRestore::on_session_restored_callbacks()); | 766 SessionRestore::on_session_restored_callbacks()); |
767 return restorer->Restore(); | 767 return restorer->Restore(); |
768 } | 768 } |
769 | 769 |
770 // static | 770 // static |
771 void SessionRestore::RestoreSessionAfterCrash(Browser* browser) { | 771 void SessionRestore::RestoreSessionAfterCrash(Browser* browser) { |
772 uint32_t behavior = 0; | 772 uint32_t behavior = 0; |
773 if (browser->tab_strip_model()->count() == 1) { | 773 if (browser->tab_strip_model()->count() == 1) { |
774 const content::WebContents* active_tab = | 774 const content::WebContents* active_tab = |
775 browser->tab_strip_model()->GetWebContentsAt(0); | 775 browser->tab_strip_model()->GetWebContentsAt(0); |
776 if (active_tab->GetURL() == GURL(chrome::kChromeUINewTabURL) || | 776 if (active_tab->GetURL() == chrome::kChromeUINewTabURL || |
777 search::IsInstantNTP(active_tab)) { | 777 search::IsInstantNTP(active_tab)) { |
778 // There is only one tab and its the new tab page, make session restore | 778 // There is only one tab and its the new tab page, make session restore |
779 // clobber it. | 779 // clobber it. |
780 behavior = SessionRestore::CLOBBER_CURRENT_TAB; | 780 behavior = SessionRestore::CLOBBER_CURRENT_TAB; |
781 } | 781 } |
782 } | 782 } |
783 SessionRestore::RestoreSession(browser->profile(), browser, behavior, | 783 SessionRestore::RestoreSession(browser->profile(), browser, behavior, |
784 std::vector<GURL>()); | 784 std::vector<GURL>()); |
785 } | 785 } |
786 | 786 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 // static | 838 // static |
839 SessionRestore::CallbackSubscription | 839 SessionRestore::CallbackSubscription |
840 SessionRestore::RegisterOnSessionRestoredCallback( | 840 SessionRestore::RegisterOnSessionRestoredCallback( |
841 const base::Callback<void(int)>& callback) { | 841 const base::Callback<void(int)>& callback) { |
842 return on_session_restored_callbacks()->Add(callback); | 842 return on_session_restored_callbacks()->Add(callback); |
843 } | 843 } |
844 | 844 |
845 // static | 845 // static |
846 base::CallbackList<void(int)>* | 846 base::CallbackList<void(int)>* |
847 SessionRestore::on_session_restored_callbacks_ = nullptr; | 847 SessionRestore::on_session_restored_callbacks_ = nullptr; |
OLD | NEW |