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 <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 return restorer->Restore(); | 773 return restorer->Restore(); |
774 } | 774 } |
775 | 775 |
776 // static | 776 // static |
777 void SessionRestore::RestoreSessionAfterCrash(Browser* browser) { | 777 void SessionRestore::RestoreSessionAfterCrash(Browser* browser) { |
778 uint32 behavior = 0; | 778 uint32 behavior = 0; |
779 if (browser->tab_strip_model()->count() == 1) { | 779 if (browser->tab_strip_model()->count() == 1) { |
780 const content::WebContents* active_tab = | 780 const content::WebContents* active_tab = |
781 browser->tab_strip_model()->GetWebContentsAt(0); | 781 browser->tab_strip_model()->GetWebContentsAt(0); |
782 if (active_tab->GetURL() == GURL(chrome::kChromeUINewTabURL) || | 782 if (active_tab->GetURL() == GURL(chrome::kChromeUINewTabURL) || |
783 chrome::IsInstantNTP(active_tab)) { | 783 search::IsInstantNTP(active_tab)) { |
784 // There is only one tab and its the new tab page, make session restore | 784 // There is only one tab and its the new tab page, make session restore |
785 // clobber it. | 785 // clobber it. |
786 behavior = SessionRestore::CLOBBER_CURRENT_TAB; | 786 behavior = SessionRestore::CLOBBER_CURRENT_TAB; |
787 } | 787 } |
788 } | 788 } |
789 SessionRestore::RestoreSession(browser->profile(), browser, | 789 SessionRestore::RestoreSession(browser->profile(), browser, |
790 browser->host_desktop_type(), behavior, | 790 browser->host_desktop_type(), behavior, |
791 std::vector<GURL>()); | 791 std::vector<GURL>()); |
792 } | 792 } |
793 | 793 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 if (prioritize_tabs == "mru") | 858 if (prioritize_tabs == "mru") |
859 return SMART_RESTORE_MODE_MRU; | 859 return SMART_RESTORE_MODE_MRU; |
860 if (prioritize_tabs == "simple") | 860 if (prioritize_tabs == "simple") |
861 return SMART_RESTORE_MODE_SIMPLE; | 861 return SMART_RESTORE_MODE_SIMPLE; |
862 return SMART_RESTORE_MODE_OFF; | 862 return SMART_RESTORE_MODE_OFF; |
863 } | 863 } |
864 | 864 |
865 // static | 865 // static |
866 base::CallbackList<void(int)>* | 866 base::CallbackList<void(int)>* |
867 SessionRestore::on_session_restored_callbacks_ = nullptr; | 867 SessionRestore::on_session_restored_callbacks_ = nullptr; |
OLD | NEW |