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_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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 false, // selected | 615 false, // selected |
616 tab.pinned, | 616 tab.pinned, |
617 true, | 617 true, |
618 NULL, | 618 NULL, |
619 tab.user_agent_override); | 619 tab.user_agent_override); |
620 // Start loading the tab immediately. | 620 // Start loading the tab immediately. |
621 web_contents->GetController().LoadIfNecessary(); | 621 web_contents->GetController().LoadIfNecessary(); |
622 } | 622 } |
623 | 623 |
624 if (use_new_window) { | 624 if (use_new_window) { |
625 chrome::ActivateTabAt(browser, 0, true); | 625 browser->tab_strip_model()->ActivateTabAt(0, true); |
626 browser->window()->Show(); | 626 browser->window()->Show(); |
627 } | 627 } |
628 NotifySessionServiceOfRestoredTabs(browser, browser->tab_count()); | 628 NotifySessionServiceOfRestoredTabs(browser, browser->tab_count()); |
629 | 629 |
630 // Since FinishedTabCreation() is not called here, |this| will leak if we | 630 // Since FinishedTabCreation() is not called here, |this| will leak if we |
631 // are not in sychronous mode. | 631 // are not in sychronous mode. |
632 DCHECK(synchronous_); | 632 DCHECK(synchronous_); |
633 } | 633 } |
634 | 634 |
635 ~SessionRestoreImpl() { | 635 ~SessionRestoreImpl() { |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 params.app_name = app_name; | 1014 params.app_name = app_name; |
1015 params.initial_bounds = bounds; | 1015 params.initial_bounds = bounds; |
1016 params.initial_show_state = show_state; | 1016 params.initial_show_state = show_state; |
1017 params.is_session_restore = true; | 1017 params.is_session_restore = true; |
1018 return new Browser(params); | 1018 return new Browser(params); |
1019 } | 1019 } |
1020 | 1020 |
1021 void ShowBrowser(Browser* browser, int selected_tab_index) { | 1021 void ShowBrowser(Browser* browser, int selected_tab_index) { |
1022 DCHECK(browser); | 1022 DCHECK(browser); |
1023 DCHECK(browser->tab_count()); | 1023 DCHECK(browser->tab_count()); |
1024 chrome::ActivateTabAt(browser, selected_tab_index, true); | 1024 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); |
1025 | 1025 |
1026 if (browser_ == browser) | 1026 if (browser_ == browser) |
1027 return; | 1027 return; |
1028 | 1028 |
1029 #if defined(USE_ASH) | 1029 #if defined(USE_ASH) |
1030 // Prevent the auto window management for this window on show. | 1030 // Prevent the auto window management for this window on show. |
1031 ash::wm::SetUserHasChangedWindowPositionOrSize( | 1031 ash::wm::SetUserHasChangedWindowPositionOrSize( |
1032 browser->window()->GetNativeWindow(), true); | 1032 browser->window()->GetNativeWindow(), true); |
1033 #endif | 1033 #endif |
1034 browser->window()->Show(); | 1034 browser->window()->Show(); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 if (active_session_restorers == NULL) | 1185 if (active_session_restorers == NULL) |
1186 return false; | 1186 return false; |
1187 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1187 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1188 active_session_restorers->begin(); | 1188 active_session_restorers->begin(); |
1189 it != active_session_restorers->end(); ++it) { | 1189 it != active_session_restorers->end(); ++it) { |
1190 if ((*it)->profile() == profile) | 1190 if ((*it)->profile() == profile) |
1191 return true; | 1191 return true; |
1192 } | 1192 } |
1193 return false; | 1193 return false; |
1194 } | 1194 } |
OLD | NEW |