OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #import "chrome/browser/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 DownloadService* download_service = | 665 DownloadService* download_service = |
666 DownloadServiceFactory::GetForProfile(profiles[i]); | 666 DownloadServiceFactory::GetForProfile(profiles[i]); |
667 DownloadManager* download_manager = | 667 DownloadManager* download_manager = |
668 (download_service->HasCreatedDownloadManager() ? | 668 (download_service->HasCreatedDownloadManager() ? |
669 BrowserContext::GetDownloadManager(profiles[i]) : NULL); | 669 BrowserContext::GetDownloadManager(profiles[i]) : NULL); |
670 if (download_manager && download_manager->InProgressCount() > 0) { | 670 if (download_manager && download_manager->InProgressCount() > 0) { |
671 int downloadCount = download_manager->InProgressCount(); | 671 int downloadCount = download_manager->InProgressCount(); |
672 if ([self userWillWaitForInProgressDownloads:downloadCount]) { | 672 if ([self userWillWaitForInProgressDownloads:downloadCount]) { |
673 // Create a new browser window (if necessary) and navigate to the | 673 // Create a new browser window (if necessary) and navigate to the |
674 // downloads page if the user chooses to wait. | 674 // downloads page if the user chooses to wait. |
675 Browser* browser = browser::FindBrowserWithProfile( | 675 Browser* browser = browser::FindBrowserWithProfile(profiles[i]); |
676 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE); | |
677 if (!browser) { | 676 if (!browser) { |
678 browser = new Browser(Browser::CreateParams(profiles[i])); | 677 browser = new Browser(Browser::CreateParams(profiles[i])); |
679 browser->window()->Show(); | 678 browser->window()->Show(); |
680 } | 679 } |
681 DCHECK(browser); | 680 DCHECK(browser); |
682 chrome::ShowDownloads(browser); | 681 chrome::ShowDownloads(browser); |
683 return NO; | 682 return NO; |
684 } | 683 } |
685 | 684 |
686 // User wants to exit. | 685 // User wants to exit. |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 | 1290 |
1292 //--------------------------------------------------------------------------- | 1291 //--------------------------------------------------------------------------- |
1293 | 1292 |
1294 namespace app_controller_mac { | 1293 namespace app_controller_mac { |
1295 | 1294 |
1296 bool IsOpeningNewWindow() { | 1295 bool IsOpeningNewWindow() { |
1297 return g_is_opening_new_window; | 1296 return g_is_opening_new_window; |
1298 } | 1297 } |
1299 | 1298 |
1300 } // namespace app_controller_mac | 1299 } // namespace app_controller_mac |
OLD | NEW |