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 <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2890 | 2890 |
2891 // Save what the user's currently typing, so it can be restored when we | 2891 // Save what the user's currently typing, so it can be restored when we |
2892 // switch back to this tab. | 2892 // switch back to this tab. |
2893 window_->GetLocationBar()->SaveStateToContents(contents->tab_contents()); | 2893 window_->GetLocationBar()->SaveStateToContents(contents->tab_contents()); |
2894 } | 2894 } |
2895 | 2895 |
2896 void Browser::ActiveTabChanged(TabContentsWrapper* old_contents, | 2896 void Browser::ActiveTabChanged(TabContentsWrapper* old_contents, |
2897 TabContentsWrapper* new_contents, | 2897 TabContentsWrapper* new_contents, |
2898 int index, | 2898 int index, |
2899 bool user_gesture) { | 2899 bool user_gesture) { |
2900 if (old_contents == new_contents) | |
2901 return; | |
2902 | |
2903 // On some platforms we want to automatically reload tabs that are | 2900 // On some platforms we want to automatically reload tabs that are |
2904 // killed when the user selects them. | 2901 // killed when the user selects them. |
2905 if (user_gesture && new_contents->tab_contents()->crashed_status() == | 2902 if (user_gesture && new_contents->tab_contents()->crashed_status() == |
2906 base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { | 2903 base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
2907 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 2904 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
2908 if (parsed_command_line.HasSwitch(switches::kReloadKilledTabs)) { | 2905 if (parsed_command_line.HasSwitch(switches::kReloadKilledTabs)) { |
2909 Reload(CURRENT_TAB); | 2906 Reload(CURRENT_TAB); |
2910 return; | 2907 return; |
2911 } | 2908 } |
2912 } | 2909 } |
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4681 TabContents* current_tab = GetSelectedTabContents(); | 4678 TabContents* current_tab = GetSelectedTabContents(); |
4682 if (current_tab) { | 4679 if (current_tab) { |
4683 content_restrictions = current_tab->content_restrictions(); | 4680 content_restrictions = current_tab->content_restrictions(); |
4684 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4681 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
4685 // See comment in UpdateCommandsForTabState about why we call url(). | 4682 // See comment in UpdateCommandsForTabState about why we call url(). |
4686 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4683 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
4687 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4684 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
4688 } | 4685 } |
4689 return content_restrictions; | 4686 return content_restrictions; |
4690 } | 4687 } |
OLD | NEW |