OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 content::Source<Browser>(this), | 1069 content::Source<Browser>(this), |
1070 content::Details<bool>(&exiting)); | 1070 content::Details<bool>(&exiting)); |
1071 | 1071 |
1072 CloseAllTabs(); | 1072 CloseAllTabs(); |
1073 } | 1073 } |
1074 | 1074 |
1075 void Browser::OnWindowActivated() { | 1075 void Browser::OnWindowActivated() { |
1076 // On some platforms we want to automatically reload tabs that are | 1076 // On some platforms we want to automatically reload tabs that are |
1077 // killed when the user selects them. | 1077 // killed when the user selects them. |
1078 TabContents* contents = GetSelectedTabContents(); | 1078 TabContents* contents = GetSelectedTabContents(); |
1079 if (contents && contents->crashed_status() == | 1079 if (contents && contents->GetCrashedStatus() == |
1080 base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { | 1080 base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
1081 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1081 if (CommandLine::ForCurrentProcess()->HasSwitch( |
1082 switches::kReloadKilledTabs)) { | 1082 switches::kReloadKilledTabs)) { |
1083 Reload(CURRENT_TAB); | 1083 Reload(CURRENT_TAB); |
1084 } | 1084 } |
1085 } | 1085 } |
1086 } | 1086 } |
1087 | 1087 |
1088 //////////////////////////////////////////////////////////////////////////////// | 1088 //////////////////////////////////////////////////////////////////////////////// |
1089 // In-progress download termination handling: | 1089 // In-progress download termination handling: |
(...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3294 // switch back to this tab. | 3294 // switch back to this tab. |
3295 window_->GetLocationBar()->SaveStateToContents(contents->tab_contents()); | 3295 window_->GetLocationBar()->SaveStateToContents(contents->tab_contents()); |
3296 } | 3296 } |
3297 | 3297 |
3298 void Browser::ActiveTabChanged(TabContentsWrapper* old_contents, | 3298 void Browser::ActiveTabChanged(TabContentsWrapper* old_contents, |
3299 TabContentsWrapper* new_contents, | 3299 TabContentsWrapper* new_contents, |
3300 int index, | 3300 int index, |
3301 bool user_gesture) { | 3301 bool user_gesture) { |
3302 // On some platforms we want to automatically reload tabs that are | 3302 // On some platforms we want to automatically reload tabs that are |
3303 // killed when the user selects them. | 3303 // killed when the user selects them. |
3304 if (user_gesture && new_contents->tab_contents()->crashed_status() == | 3304 if (user_gesture && new_contents->tab_contents()->GetCrashedStatus() == |
3305 base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { | 3305 base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
3306 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 3306 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
3307 if (parsed_command_line.HasSwitch(switches::kReloadKilledTabs)) { | 3307 if (parsed_command_line.HasSwitch(switches::kReloadKilledTabs)) { |
3308 Reload(CURRENT_TAB); | 3308 Reload(CURRENT_TAB); |
3309 return; | 3309 return; |
3310 } | 3310 } |
3311 } | 3311 } |
3312 | 3312 |
3313 // Discarded tabs always get reloaded. | 3313 // Discarded tabs always get reloaded. |
3314 if (IsTabDiscarded(index)) { | 3314 if (IsTabDiscarded(index)) { |
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5374 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5374 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5375 } else { | 5375 } else { |
5376 GlobalErrorService* service = | 5376 GlobalErrorService* service = |
5377 GlobalErrorServiceFactory::GetForProfile(profile()); | 5377 GlobalErrorServiceFactory::GetForProfile(profile()); |
5378 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5378 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5379 if (error) { | 5379 if (error) { |
5380 error->ShowBubbleView(this); | 5380 error->ShowBubbleView(this); |
5381 } | 5381 } |
5382 } | 5382 } |
5383 } | 5383 } |
OLD | NEW |