| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 TabRestoreServiceFactory::GetForProfile(profile()); | 744 TabRestoreServiceFactory::GetForProfile(profile()); |
| 745 | 745 |
| 746 #if defined(USE_AURA) | 746 #if defined(USE_AURA) |
| 747 if (tab_restore_service && is_app() && !is_devtools()) | 747 if (tab_restore_service && is_app() && !is_devtools()) |
| 748 tab_restore_service->BrowserClosing(live_tab_context()); | 748 tab_restore_service->BrowserClosing(live_tab_context()); |
| 749 #endif | 749 #endif |
| 750 | 750 |
| 751 if (tab_restore_service && is_type_tabbed() && tab_strip_model_->count()) | 751 if (tab_restore_service && is_type_tabbed() && tab_strip_model_->count()) |
| 752 tab_restore_service->BrowserClosing(live_tab_context()); | 752 tab_restore_service->BrowserClosing(live_tab_context()); |
| 753 | 753 |
| 754 // TODO(sky): convert session/tab restore to use notification. | 754 BrowserList::NotifyBrowserCloseStarted(this); |
| 755 content::NotificationService::current()->Notify( | |
| 756 chrome::NOTIFICATION_BROWSER_CLOSING, | |
| 757 content::Source<Browser>(this), | |
| 758 content::NotificationService::NoDetails()); | |
| 759 | 755 |
| 760 if (!IsFastTabUnloadEnabled()) | 756 if (!IsFastTabUnloadEnabled()) |
| 761 tab_strip_model_->CloseAllTabs(); | 757 tab_strip_model_->CloseAllTabs(); |
| 762 } | 758 } |
| 763 | 759 |
| 764 //////////////////////////////////////////////////////////////////////////////// | 760 //////////////////////////////////////////////////////////////////////////////// |
| 765 // In-progress download termination handling: | 761 // In-progress download termination handling: |
| 766 | 762 |
| 767 void Browser::InProgressDownloadResponse(bool cancel_downloads) { | 763 void Browser::InProgressDownloadResponse(bool cancel_downloads) { |
| 768 if (cancel_downloads) { | 764 if (cancel_downloads) { |
| (...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2634 // new window later, thus we need to navigate the window now. | 2630 // new window later, thus we need to navigate the window now. |
| 2635 if (contents) { | 2631 if (contents) { |
| 2636 contents->web_contents()->GetController().LoadURL( | 2632 contents->web_contents()->GetController().LoadURL( |
| 2637 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, | 2633 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
| 2638 std::string()); // No extra headers. | 2634 std::string()); // No extra headers. |
| 2639 } | 2635 } |
| 2640 } | 2636 } |
| 2641 | 2637 |
| 2642 return contents != NULL; | 2638 return contents != NULL; |
| 2643 } | 2639 } |
| OLD | NEW |