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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "webkit/glue/glue_serialize.h" | 50 #include "webkit/glue/glue_serialize.h" |
51 | 51 |
52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
53 #include "chrome/browser/chromeos/boot_times_loader.h" | 53 #include "chrome/browser/chromeos/boot_times_loader.h" |
54 #endif | 54 #endif |
55 | 55 |
56 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
57 #include "base/win/metro.h" | 57 #include "base/win/metro.h" |
58 #endif | 58 #endif |
59 | 59 |
| 60 #if defined(USE_ASH) |
| 61 #include "ash/wm/window_util.h" |
| 62 #endif |
60 using content::NavigationController; | 63 using content::NavigationController; |
61 using content::RenderWidgetHost; | 64 using content::RenderWidgetHost; |
62 using content::WebContents; | 65 using content::WebContents; |
63 | 66 |
64 namespace { | 67 namespace { |
65 | 68 |
66 class SessionRestoreImpl; | 69 class SessionRestoreImpl; |
67 class TabLoader; | 70 class TabLoader; |
68 | 71 |
69 TabLoader* shared_tab_loader = NULL; | 72 TabLoader* shared_tab_loader = NULL; |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 } | 1016 } |
1014 | 1017 |
1015 void ShowBrowser(Browser* browser, int selected_tab_index) { | 1018 void ShowBrowser(Browser* browser, int selected_tab_index) { |
1016 DCHECK(browser); | 1019 DCHECK(browser); |
1017 DCHECK(browser->tab_count()); | 1020 DCHECK(browser->tab_count()); |
1018 chrome::ActivateTabAt(browser, selected_tab_index, true); | 1021 chrome::ActivateTabAt(browser, selected_tab_index, true); |
1019 | 1022 |
1020 if (browser_ == browser) | 1023 if (browser_ == browser) |
1021 return; | 1024 return; |
1022 | 1025 |
| 1026 #if defined(USE_ASH) |
| 1027 // Prevent the auto window management for this window on show. |
| 1028 ash::wm::SetUserHasChangedWindowPositionOrSize( |
| 1029 browser->window()->GetNativeWindow(), true); |
| 1030 #endif |
1023 browser->window()->Show(); | 1031 browser->window()->Show(); |
| 1032 #if defined(USE_ASH) |
| 1033 ash::wm::SetUserHasChangedWindowPositionOrSize( |
| 1034 browser->window()->GetNativeWindow(), false); |
| 1035 #endif |
1024 browser->set_is_session_restore(false); | 1036 browser->set_is_session_restore(false); |
1025 | 1037 |
1026 // TODO(jcampan): http://crbug.com/8123 we should not need to set the | 1038 // TODO(jcampan): http://crbug.com/8123 we should not need to set the |
1027 // initial focus explicitly. | 1039 // initial focus explicitly. |
1028 chrome::GetActiveWebContents(browser)->GetView()->SetInitialFocus(); | 1040 chrome::GetActiveWebContents(browser)->GetView()->SetInitialFocus(); |
1029 | 1041 |
1030 if (!browser_shown_) { | 1042 if (!browser_shown_) { |
1031 browser_shown_ = true; | 1043 browser_shown_ = true; |
1032 base::TimeDelta time_to_first_show = | 1044 base::TimeDelta time_to_first_show = |
1033 base::TimeTicks::Now() - restore_started_; | 1045 base::TimeTicks::Now() - restore_started_; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 if (active_session_restorers == NULL) | 1184 if (active_session_restorers == NULL) |
1173 return false; | 1185 return false; |
1174 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1186 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1175 active_session_restorers->begin(); | 1187 active_session_restorers->begin(); |
1176 it != active_session_restorers->end(); ++it) { | 1188 it != active_session_restorers->end(); ++it) { |
1177 if ((*it)->profile() == profile) | 1189 if ((*it)->profile() == profile) |
1178 return true; | 1190 return true; |
1179 } | 1191 } |
1180 return false; | 1192 return false; |
1181 } | 1193 } |
OLD | NEW |