| 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 params = Browser::CreateParams::CreateForApp( |
| 1072 Browser::TYPE_HOSTED_POPUP, app_name, bounds, |
| 1073 profile_, host_desktop_type_); |
| 1074 } else { |
| 1075 params.initial_bounds = bounds; |
| 1076 } |
| 1072 params.initial_show_state = show_state; | 1077 params.initial_show_state = show_state; |
| 1073 params.is_session_restore = true; | 1078 params.is_session_restore = true; |
| 1074 return new Browser(params); | 1079 return new Browser(params); |
| 1075 } | 1080 } |
| 1076 | 1081 |
| 1077 void ShowBrowser(Browser* browser, int selected_tab_index) { | 1082 void ShowBrowser(Browser* browser, int selected_tab_index) { |
| 1078 DCHECK(browser); | 1083 DCHECK(browser); |
| 1079 DCHECK(browser->tab_strip_model()->count()); | 1084 DCHECK(browser->tab_strip_model()->count()); |
| 1080 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); | 1085 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); |
| 1081 | 1086 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 if (!active_session_restorers) | 1260 if (!active_session_restorers) |
| 1256 return false; | 1261 return false; |
| 1257 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1262 for (std::set<SessionRestoreImpl*>::const_iterator it = |
| 1258 active_session_restorers->begin(); | 1263 active_session_restorers->begin(); |
| 1259 it != active_session_restorers->end(); ++it) { | 1264 it != active_session_restorers->end(); ++it) { |
| 1260 if ((*it)->synchronous()) | 1265 if ((*it)->synchronous()) |
| 1261 return true; | 1266 return true; |
| 1262 } | 1267 } |
| 1263 return false; | 1268 return false; |
| 1264 } | 1269 } |
| OLD | NEW |