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(profiles[i]); | 675 Browser* browser = browser::FindBrowserWithProfile( |
| 676 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE); |
676 if (!browser) { | 677 if (!browser) { |
677 browser = new Browser(Browser::CreateParams(profiles[i])); | 678 browser = new Browser(Browser::CreateParams(profiles[i])); |
678 browser->window()->Show(); | 679 browser->window()->Show(); |
679 } | 680 } |
680 DCHECK(browser); | 681 DCHECK(browser); |
681 chrome::ShowDownloads(browser); | 682 chrome::ShowDownloads(browser); |
682 return NO; | 683 return NO; |
683 } | 684 } |
684 | 685 |
685 // User wants to exit. | 686 // User wants to exit. |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 | 1291 |
1291 //--------------------------------------------------------------------------- | 1292 //--------------------------------------------------------------------------- |
1292 | 1293 |
1293 namespace app_controller_mac { | 1294 namespace app_controller_mac { |
1294 | 1295 |
1295 bool IsOpeningNewWindow() { | 1296 bool IsOpeningNewWindow() { |
1296 return g_is_opening_new_window; | 1297 return g_is_opening_new_window; |
1297 } | 1298 } |
1298 | 1299 |
1299 } // namespace app_controller_mac | 1300 } // namespace app_controller_mac |
OLD | NEW |