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; |
1038 params.initial_show_state = show_state; | 1039 #if defined(USE_ASH) |
1040 if (ash::Shell::IsForcedMaximizeMode()) | |
1041 params.initial_show_state = ui::SHOW_STATE_MAXIMIZED; | |
1042 else | |
1043 #endif | |
James Cook
2013/04/22 22:15:46
#ifdefs that mess with indentation I find hard to
Mr4D (OOO till 08-26)
2013/04/23 04:41:28
I tried to avoid that. However since you want it:
| |
1044 params.initial_show_state = show_state; | |
1039 params.is_session_restore = true; | 1045 params.is_session_restore = true; |
1040 return new Browser(params); | 1046 return new Browser(params); |
1041 } | 1047 } |
1042 | 1048 |
1043 void ShowBrowser(Browser* browser, int selected_tab_index) { | 1049 void ShowBrowser(Browser* browser, int selected_tab_index) { |
1044 DCHECK(browser); | 1050 DCHECK(browser); |
1045 DCHECK(browser->tab_strip_model()->count()); | 1051 DCHECK(browser->tab_strip_model()->count()); |
1046 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); | 1052 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); |
1047 | 1053 |
1048 if (browser_ == browser) | 1054 if (browser_ == browser) |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1230 if (!active_session_restorers) | 1236 if (!active_session_restorers) |
1231 return false; | 1237 return false; |
1232 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1238 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1233 active_session_restorers->begin(); | 1239 active_session_restorers->begin(); |
1234 it != active_session_restorers->end(); ++it) { | 1240 it != active_session_restorers->end(); ++it) { |
1235 if ((*it)->synchronous()) | 1241 if ((*it)->synchronous()) |
1236 return true; | 1242 return true; |
1237 } | 1243 } |
1238 return false; | 1244 return false; |
1239 } | 1245 } |
OLD | NEW |