| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
| 55 #include "chrome/browser/chromeos/boot_times_loader.h" | 55 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
| 59 #include "win8/util/win8_util.h" | 59 #include "win8/util/win8_util.h" |
| 60 #endif | 60 #endif |
| 61 | 61 |
| 62 #if defined(USE_ASH) | 62 #if defined(USE_ASH) |
| 63 #include "ash/shell.h" |
| 63 #include "ash/wm/window_util.h" | 64 #include "ash/wm/window_util.h" |
| 64 #endif | 65 #endif |
| 65 using content::NavigationController; | 66 using content::NavigationController; |
| 66 using content::RenderWidgetHost; | 67 using content::RenderWidgetHost; |
| 67 using content::WebContents; | 68 using content::WebContents; |
| 68 | 69 |
| 69 namespace { | 70 namespace { |
| 70 | 71 |
| 71 class SessionRestoreImpl; | 72 class SessionRestoreImpl; |
| 72 class TabLoader; | 73 class TabLoader; |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 return web_contents; | 1029 return web_contents; |
| 1029 } | 1030 } |
| 1030 | 1031 |
| 1031 Browser* CreateRestoredBrowser(Browser::Type type, | 1032 Browser* CreateRestoredBrowser(Browser::Type type, |
| 1032 gfx::Rect bounds, | 1033 gfx::Rect bounds, |
| 1033 ui::WindowShowState show_state, | 1034 ui::WindowShowState show_state, |
| 1034 const std::string& app_name) { | 1035 const std::string& app_name) { |
| 1035 Browser::CreateParams params(type, profile_, host_desktop_type_); | 1036 Browser::CreateParams params(type, profile_, host_desktop_type_); |
| 1036 params.app_name = app_name; | 1037 params.app_name = app_name; |
| 1037 params.initial_bounds = bounds; | 1038 params.initial_bounds = bounds; |
| 1039 #if defined(USE_ASH) |
| 1040 if (ash::Shell::IsForcedMaximizeMode()) |
| 1041 show_state = ui::SHOW_STATE_MAXIMIZED; |
| 1042 #endif |
| 1038 params.initial_show_state = show_state; | 1043 params.initial_show_state = show_state; |
| 1039 params.is_session_restore = true; | 1044 params.is_session_restore = true; |
| 1040 return new Browser(params); | 1045 return new Browser(params); |
| 1041 } | 1046 } |
| 1042 | 1047 |
| 1043 void ShowBrowser(Browser* browser, int selected_tab_index) { | 1048 void ShowBrowser(Browser* browser, int selected_tab_index) { |
| 1044 DCHECK(browser); | 1049 DCHECK(browser); |
| 1045 DCHECK(browser->tab_strip_model()->count()); | 1050 DCHECK(browser->tab_strip_model()->count()); |
| 1046 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); | 1051 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); |
| 1047 | 1052 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 if (!active_session_restorers) | 1235 if (!active_session_restorers) |
| 1231 return false; | 1236 return false; |
| 1232 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1237 for (std::set<SessionRestoreImpl*>::const_iterator it = |
| 1233 active_session_restorers->begin(); | 1238 active_session_restorers->begin(); |
| 1234 it != active_session_restorers->end(); ++it) { | 1239 it != active_session_restorers->end(); ++it) { |
| 1235 if ((*it)->synchronous()) | 1240 if ((*it)->synchronous()) |
| 1236 return true; | 1241 return true; |
| 1237 } | 1242 } |
| 1238 return false; | 1243 return false; |
| 1239 } | 1244 } |
| OLD | NEW |