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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 DownloadService* download_service = | 645 DownloadService* download_service = |
646 DownloadServiceFactory::GetForProfile(profiles[i]); | 646 DownloadServiceFactory::GetForProfile(profiles[i]); |
647 DownloadManager* download_manager = | 647 DownloadManager* download_manager = |
648 (download_service->HasCreatedDownloadManager() ? | 648 (download_service->HasCreatedDownloadManager() ? |
649 BrowserContext::GetDownloadManager(profiles[i]) : NULL); | 649 BrowserContext::GetDownloadManager(profiles[i]) : NULL); |
650 if (download_manager && download_manager->InProgressCount() > 0) { | 650 if (download_manager && download_manager->InProgressCount() > 0) { |
651 int downloadCount = download_manager->InProgressCount(); | 651 int downloadCount = download_manager->InProgressCount(); |
652 if ([self userWillWaitForInProgressDownloads:downloadCount]) { | 652 if ([self userWillWaitForInProgressDownloads:downloadCount]) { |
653 // Create a new browser window (if necessary) and navigate to the | 653 // Create a new browser window (if necessary) and navigate to the |
654 // downloads page if the user chooses to wait. | 654 // downloads page if the user chooses to wait. |
655 Browser* browser = browser::FindBrowserWithProfile( | 655 Browser* browser = chrome::FindBrowserWithProfile( |
656 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE); | 656 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE); |
657 if (!browser) { | 657 if (!browser) { |
658 browser = new Browser(Browser::CreateParams(profiles[i])); | 658 browser = new Browser(Browser::CreateParams(profiles[i])); |
659 browser->window()->Show(); | 659 browser->window()->Show(); |
660 } | 660 } |
661 DCHECK(browser); | 661 DCHECK(browser); |
662 chrome::ShowDownloads(browser); | 662 chrome::ShowDownloads(browser); |
663 return NO; | 663 return NO; |
664 } | 664 } |
665 | 665 |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 | 1273 |
1274 //--------------------------------------------------------------------------- | 1274 //--------------------------------------------------------------------------- |
1275 | 1275 |
1276 namespace app_controller_mac { | 1276 namespace app_controller_mac { |
1277 | 1277 |
1278 bool IsOpeningNewWindow() { | 1278 bool IsOpeningNewWindow() { |
1279 return g_is_opening_new_window; | 1279 return g_is_opening_new_window; |
1280 } | 1280 } |
1281 | 1281 |
1282 } // namespace app_controller_mac | 1282 } // namespace app_controller_mac |
OLD | NEW |