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 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 if (schedule_load) | 1060 if (schedule_load) |
1061 tab_loader_->ScheduleLoad(&web_contents->GetController()); | 1061 tab_loader_->ScheduleLoad(&web_contents->GetController()); |
1062 return web_contents; | 1062 return web_contents; |
1063 } | 1063 } |
1064 | 1064 |
1065 Browser* CreateRestoredBrowser(Browser::Type type, | 1065 Browser* CreateRestoredBrowser(Browser::Type type, |
1066 gfx::Rect bounds, | 1066 gfx::Rect bounds, |
1067 ui::WindowShowState show_state, | 1067 ui::WindowShowState show_state, |
1068 const std::string& app_name) { | 1068 const std::string& app_name) { |
1069 Browser::CreateParams params(type, profile_, host_desktop_type_); | 1069 Browser::CreateParams params(type, profile_, host_desktop_type_); |
1070 params.app_name = app_name; | 1070 if (!app_name.empty()) { |
1071 params.initial_bounds = bounds; | 1071 if (type == Browser::TYPE_TABBED) { |
| 1072 LOG(ERROR) << "Unexpected restore type in SessionRestore"; |
| 1073 type = Browser::TYPE_TRUSTED_POPUP; |
| 1074 } |
| 1075 params = Browser::CreateParams::CreateForApp( |
| 1076 type, app_name, bounds, profile_, host_desktop_type_); |
| 1077 } else { |
| 1078 params.initial_bounds = bounds; |
| 1079 } |
1072 params.initial_show_state = show_state; | 1080 params.initial_show_state = show_state; |
1073 params.is_session_restore = true; | 1081 params.is_session_restore = true; |
1074 return new Browser(params); | 1082 return new Browser(params); |
1075 } | 1083 } |
1076 | 1084 |
1077 void ShowBrowser(Browser* browser, int selected_tab_index) { | 1085 void ShowBrowser(Browser* browser, int selected_tab_index) { |
1078 DCHECK(browser); | 1086 DCHECK(browser); |
1079 DCHECK(browser->tab_strip_model()->count()); | 1087 DCHECK(browser->tab_strip_model()->count()); |
1080 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); | 1088 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); |
1081 | 1089 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 if (!active_session_restorers) | 1263 if (!active_session_restorers) |
1256 return false; | 1264 return false; |
1257 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1265 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1258 active_session_restorers->begin(); | 1266 active_session_restorers->begin(); |
1259 it != active_session_restorers->end(); ++it) { | 1267 it != active_session_restorers->end(); ++it) { |
1260 if ((*it)->synchronous()) | 1268 if ((*it)->synchronous()) |
1261 return true; | 1269 return true; |
1262 } | 1270 } |
1263 return false; | 1271 return false; |
1264 } | 1272 } |
OLD | NEW |