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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1034 return web_contents; | 1035 return web_contents; |
1035 } | 1036 } |
1036 | 1037 |
1037 Browser* CreateRestoredBrowser(Browser::Type type, | 1038 Browser* CreateRestoredBrowser(Browser::Type type, |
1038 gfx::Rect bounds, | 1039 gfx::Rect bounds, |
1039 ui::WindowShowState show_state, | 1040 ui::WindowShowState show_state, |
1040 const std::string& app_name) { | 1041 const std::string& app_name) { |
1041 Browser::CreateParams params(type, profile_, host_desktop_type_); | 1042 Browser::CreateParams params(type, profile_, host_desktop_type_); |
1042 params.app_name = app_name; | 1043 params.app_name = app_name; |
1043 params.initial_bounds = bounds; | 1044 params.initial_bounds = bounds; |
1045 #if defined(USE_ASH) | |
1046 if (ash::Shell::IsForcedMaximizeMode()) | |
sky
2013/04/24 00:31:59
It seems like we shouldn't have to patch all the c
| |
1047 show_state = ui::SHOW_STATE_MAXIMIZED; | |
1048 #endif | |
1044 params.initial_show_state = show_state; | 1049 params.initial_show_state = show_state; |
1045 params.is_session_restore = true; | 1050 params.is_session_restore = true; |
1046 return new Browser(params); | 1051 return new Browser(params); |
1047 } | 1052 } |
1048 | 1053 |
1049 void ShowBrowser(Browser* browser, int selected_tab_index) { | 1054 void ShowBrowser(Browser* browser, int selected_tab_index) { |
1050 DCHECK(browser); | 1055 DCHECK(browser); |
1051 DCHECK(browser->tab_strip_model()->count()); | 1056 DCHECK(browser->tab_strip_model()->count()); |
1052 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); | 1057 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); |
1053 | 1058 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1236 if (!active_session_restorers) | 1241 if (!active_session_restorers) |
1237 return false; | 1242 return false; |
1238 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1243 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1239 active_session_restorers->begin(); | 1244 active_session_restorers->begin(); |
1240 it != active_session_restorers->end(); ++it) { | 1245 it != active_session_restorers->end(); ++it) { |
1241 if ((*it)->synchronous()) | 1246 if ((*it)->synchronous()) |
1242 return true; | 1247 return true; |
1243 } | 1248 } |
1244 return false; | 1249 return false; |
1245 } | 1250 } |
OLD | NEW |