| 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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 | 965 |
| 966 // TODO(sky): convert session/tab restore to use notification. | 966 // TODO(sky): convert session/tab restore to use notification. |
| 967 NotificationService::current()->Notify( | 967 NotificationService::current()->Notify( |
| 968 NotificationType::BROWSER_CLOSING, | 968 NotificationType::BROWSER_CLOSING, |
| 969 Source<Browser>(this), | 969 Source<Browser>(this), |
| 970 Details<bool>(&exiting)); | 970 Details<bool>(&exiting)); |
| 971 | 971 |
| 972 CloseAllTabs(); | 972 CloseAllTabs(); |
| 973 } | 973 } |
| 974 | 974 |
| 975 void Browser::OnWindowActivated() { |
| 976 // On some platforms we want to automatically reload tabs that are |
| 977 // killed when the user selects them. |
| 978 TabContents* contents = GetSelectedTabContents(); |
| 979 if (contents && contents->crashed_status() == |
| 980 base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
| 981 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 982 switches::kReloadKilledTabs)) { |
| 983 Reload(CURRENT_TAB); |
| 984 } |
| 985 } |
| 986 } |
| 987 |
| 975 //////////////////////////////////////////////////////////////////////////////// | 988 //////////////////////////////////////////////////////////////////////////////// |
| 976 // In-progress download termination handling: | 989 // In-progress download termination handling: |
| 977 | 990 |
| 978 void Browser::InProgressDownloadResponse(bool cancel_downloads) { | 991 void Browser::InProgressDownloadResponse(bool cancel_downloads) { |
| 979 if (cancel_downloads) { | 992 if (cancel_downloads) { |
| 980 cancel_download_confirmation_state_ = RESPONSE_RECEIVED; | 993 cancel_download_confirmation_state_ = RESPONSE_RECEIVED; |
| 981 CloseWindow(); | 994 CloseWindow(); |
| 982 return; | 995 return; |
| 983 } | 996 } |
| 984 | 997 |
| (...skipping 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4600 TabContents* current_tab = GetSelectedTabContents(); | 4613 TabContents* current_tab = GetSelectedTabContents(); |
| 4601 if (current_tab) { | 4614 if (current_tab) { |
| 4602 content_restrictions = current_tab->content_restrictions(); | 4615 content_restrictions = current_tab->content_restrictions(); |
| 4603 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4616 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
| 4604 // See comment in UpdateCommandsForTabState about why we call url(). | 4617 // See comment in UpdateCommandsForTabState about why we call url(). |
| 4605 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4618 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
| 4606 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4619 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
| 4607 } | 4620 } |
| 4608 return content_restrictions; | 4621 return content_restrictions; |
| 4609 } | 4622 } |
| OLD | NEW |