| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/lifetime/browser_close_manager.h" | 5 #include "chrome/browser/lifetime/browser_close_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 // Navigates a browser window for |profile|, creating one if necessary, to the | 28 // Navigates a browser window for |profile|, creating one if necessary, to the |
| 29 // downloads page if there are downloads in progress for |profile|. | 29 // downloads page if there are downloads in progress for |profile|. |
| 30 void ShowInProgressDownloads(Profile* profile) { | 30 void ShowInProgressDownloads(Profile* profile) { |
| 31 DownloadService* download_service = | 31 DownloadService* download_service = |
| 32 DownloadServiceFactory::GetForBrowserContext(profile); | 32 DownloadServiceFactory::GetForBrowserContext(profile); |
| 33 if (download_service->NonMaliciousDownloadCount() > 0) { | 33 if (download_service->NonMaliciousDownloadCount() > 0) { |
| 34 chrome::ScopedTabbedBrowserDisplayer displayer(profile, | 34 chrome::ScopedTabbedBrowserDisplayer displayer(profile); |
| 35 chrome::GetActiveDesktop()); | |
| 36 chrome::ShowDownloads(displayer.browser()); | 35 chrome::ShowDownloads(displayer.browser()); |
| 37 } | 36 } |
| 38 } | 37 } |
| 39 | 38 |
| 40 } // namespace | 39 } // namespace |
| 41 | 40 |
| 42 BrowserCloseManager::BrowserCloseManager() : current_browser_(nullptr) { | 41 BrowserCloseManager::BrowserCloseManager() : current_browser_(nullptr) { |
| 43 } | 42 } |
| 44 | 43 |
| 45 BrowserCloseManager::~BrowserCloseManager() { | 44 BrowserCloseManager::~BrowserCloseManager() { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 while (browser->tab_strip_model()->count()) | 175 while (browser->tab_strip_model()->count()) |
| 177 delete browser->tab_strip_model()->GetWebContentsAt(0); | 176 delete browser->tab_strip_model()->GetWebContentsAt(0); |
| 178 browser->window()->DestroyBrowser(); | 177 browser->window()->DestroyBrowser(); |
| 179 // Destroying the browser should have removed it from the browser list. | 178 // Destroying the browser should have removed it from the browser list. |
| 180 DCHECK(BrowserList::GetInstance()->end() == | 179 DCHECK(BrowserList::GetInstance()->end() == |
| 181 std::find(BrowserList::GetInstance()->begin(), | 180 std::find(BrowserList::GetInstance()->begin(), |
| 182 BrowserList::GetInstance()->end(), browser)); | 181 BrowserList::GetInstance()->end(), browser)); |
| 183 } | 182 } |
| 184 } | 183 } |
| 185 } | 184 } |
| OLD | NEW |