OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 if (!profile_manager) | 632 if (!profile_manager) |
633 return YES; | 633 return YES; |
634 | 634 |
635 std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles()); | 635 std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles()); |
636 for (size_t i = 0; i < profiles.size(); ++i) { | 636 for (size_t i = 0; i < profiles.size(); ++i) { |
637 DownloadService* download_service = | 637 DownloadService* download_service = |
638 DownloadServiceFactory::GetForProfile(profiles[i]); | 638 DownloadServiceFactory::GetForProfile(profiles[i]); |
639 DownloadManager* download_manager = | 639 DownloadManager* download_manager = |
640 (download_service->HasCreatedDownloadManager() ? | 640 (download_service->HasCreatedDownloadManager() ? |
641 download_service->GetDownloadManager() : NULL); | 641 download_service->GetDownloadManager() : NULL); |
642 if (download_manager && download_manager->in_progress_count() > 0) { | 642 if (download_manager && download_manager->InProgressCount() > 0) { |
643 int downloadCount = download_manager->in_progress_count(); | 643 int downloadCount = download_manager->InProgressCount(); |
644 if ([self userWillWaitForInProgressDownloads:downloadCount]) { | 644 if ([self userWillWaitForInProgressDownloads:downloadCount]) { |
645 // Create a new browser window (if necessary) and navigate to the | 645 // Create a new browser window (if necessary) and navigate to the |
646 // downloads page if the user chooses to wait. | 646 // downloads page if the user chooses to wait. |
647 Browser* browser = BrowserList::FindBrowserWithProfile(profiles[i]); | 647 Browser* browser = BrowserList::FindBrowserWithProfile(profiles[i]); |
648 if (!browser) { | 648 if (!browser) { |
649 browser = Browser::Create(profiles[i]); | 649 browser = Browser::Create(profiles[i]); |
650 browser->window()->Show(); | 650 browser->window()->Show(); |
651 } | 651 } |
652 DCHECK(browser); | 652 DCHECK(browser); |
653 browser->ShowDownloadsTab(); | 653 browser->ShowDownloadsTab(); |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 | 1280 |
1281 } // namespace browser | 1281 } // namespace browser |
1282 | 1282 |
1283 namespace app_controller_mac { | 1283 namespace app_controller_mac { |
1284 | 1284 |
1285 bool IsOpeningNewWindow() { | 1285 bool IsOpeningNewWindow() { |
1286 return g_is_opening_new_window; | 1286 return g_is_opening_new_window; |
1287 } | 1287 } |
1288 | 1288 |
1289 } // namespace app_controller_mac | 1289 } // namespace app_controller_mac |
OLD | NEW |