OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 10 #include <vector> |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 if (schedule_load) | 707 if (schedule_load) |
708 tab_loader_->ScheduleLoad(&tab_contents->controller()); | 708 tab_loader_->ScheduleLoad(&tab_contents->controller()); |
709 } | 709 } |
710 | 710 |
711 Browser* CreateRestoredBrowser(Browser::Type type, | 711 Browser* CreateRestoredBrowser(Browser::Type type, |
712 gfx::Rect bounds, | 712 gfx::Rect bounds, |
713 ui::WindowShowState show_state) { | 713 ui::WindowShowState show_state) { |
714 Browser* browser = new Browser(type, profile_); | 714 Browser* browser = new Browser(type, profile_); |
715 browser->set_override_bounds(bounds); | 715 browser->set_override_bounds(bounds); |
716 browser->set_show_state(show_state); | 716 browser->set_show_state(show_state); |
| 717 browser->set_is_session_restore(true); |
717 browser->InitBrowserWindow(); | 718 browser->InitBrowserWindow(); |
718 return browser; | 719 return browser; |
719 } | 720 } |
720 | 721 |
721 void ShowBrowser(Browser* browser, | 722 void ShowBrowser(Browser* browser, |
722 int initial_tab_count, | 723 int initial_tab_count, |
723 int selected_session_index) { | 724 int selected_session_index) { |
724 DCHECK(browser); | 725 DCHECK(browser); |
725 DCHECK(browser->tab_count()); | 726 DCHECK(browser->tab_count()); |
726 browser->ActivateTabAt( | 727 browser->ActivateTabAt( |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 std::vector<GURL> gurls; | 853 std::vector<GURL> gurls; |
853 SessionRestoreImpl restorer(profile, | 854 SessionRestoreImpl restorer(profile, |
854 static_cast<Browser*>(NULL), true, false, true, gurls); | 855 static_cast<Browser*>(NULL), true, false, true, gurls); |
855 restorer.RestoreForeignTab(tab); | 856 restorer.RestoreForeignTab(tab); |
856 } | 857 } |
857 | 858 |
858 // static | 859 // static |
859 bool SessionRestore::IsRestoring() { | 860 bool SessionRestore::IsRestoring() { |
860 return restoring; | 861 return restoring; |
861 } | 862 } |
OLD | NEW |