Chromium Code Reviews| Index: chrome/browser/ui/browser.cc |
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
| index a5a5fddc227c379179104ddf9186a828403384b3..816fd13f4b13468940db69202cf24c59030727d8 100644 |
| --- a/chrome/browser/ui/browser.cc |
| +++ b/chrome/browser/ui/browser.cc |
| @@ -647,8 +647,13 @@ void Browser::OnWindowActivated() { |
| // On some platforms we want to automatically reload tabs that are |
| // killed when the user selects them. |
| WebContents* contents = chrome::GetActiveWebContents(this); |
| - if (contents && contents->GetCrashedStatus() == |
| - base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
| + base::TerminationStatus crashed_status = contents->GetCrashedStatus(); |
| + bool crashed = false; |
| + if (crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || |
|
sky
2012/10/30 22:33:01
Move this into an anonmyous function that does all
simonhong_
2012/10/31 20:48:08
Done.
|
| + crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || |
| + crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED) |
| + crashed = true; |
| + if (contents && crashed) { |
| if (CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kReloadKilledTabs)) { |
| chrome::Reload(this, CURRENT_TAB); |
| @@ -1078,8 +1083,14 @@ void Browser::ActiveTabChanged(TabContents* old_contents, |
| // On some platforms we want to automatically reload tabs that are |
| // killed when the user selects them. |
| bool did_reload = false; |
| - if (user_gesture && new_contents->web_contents()->GetCrashedStatus() == |
| - base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
| + base::TerminationStatus crashed_status = |
| + new_contents->web_contents()->GetCrashedStatus(); |
| + bool crashed = false; |
| + if (crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || |
| + crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || |
| + crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED) |
| + crashed = true; |
| + if (user_gesture && crashed) { |
| const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| if (parsed_command_line.HasSwitch(switches::kReloadKilledTabs)) { |
| LOG(WARNING) << "Reloading killed tab at " << index; |