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