Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 8351052: Created a DownloadManager interface, for use in unit tests.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Mac & Clang issues. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 if (!profile_manager) 629 if (!profile_manager)
630 return YES; 630 return YES;
631 631
632 std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles()); 632 std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles());
633 for (size_t i = 0; i < profiles.size(); ++i) { 633 for (size_t i = 0; i < profiles.size(); ++i) {
634 DownloadService* download_service = 634 DownloadService* download_service =
635 DownloadServiceFactory::GetForProfile(profiles[i]); 635 DownloadServiceFactory::GetForProfile(profiles[i]);
636 DownloadManager* download_manager = 636 DownloadManager* download_manager =
637 (download_service->HasCreatedDownloadManager() ? 637 (download_service->HasCreatedDownloadManager() ?
638 download_service->GetDownloadManager() : NULL); 638 download_service->GetDownloadManager() : NULL);
639 if (download_manager && download_manager->in_progress_count() > 0) { 639 if (download_manager && download_manager->InProgressCount() > 0) {
640 int downloadCount = download_manager->in_progress_count(); 640 int downloadCount = download_manager->InProgressCount();
641 if ([self userWillWaitForInProgressDownloads:downloadCount]) { 641 if ([self userWillWaitForInProgressDownloads:downloadCount]) {
642 // Create a new browser window (if necessary) and navigate to the 642 // Create a new browser window (if necessary) and navigate to the
643 // downloads page if the user chooses to wait. 643 // downloads page if the user chooses to wait.
644 Browser* browser = BrowserList::FindBrowserWithProfile(profiles[i]); 644 Browser* browser = BrowserList::FindBrowserWithProfile(profiles[i]);
645 if (!browser) { 645 if (!browser) {
646 browser = Browser::Create(profiles[i]); 646 browser = Browser::Create(profiles[i]);
647 browser->window()->Show(); 647 browser->window()->Show();
648 } 648 }
649 DCHECK(browser); 649 DCHECK(browser);
650 browser->ShowDownloadsTab(); 650 browser->ShowDownloadsTab();
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 1266
1267 } // namespace browser 1267 } // namespace browser
1268 1268
1269 namespace app_controller_mac { 1269 namespace app_controller_mac {
1270 1270
1271 bool IsOpeningNewWindow() { 1271 bool IsOpeningNewWindow() {
1272 return g_is_opening_new_window; 1272 return g_is_opening_new_window;
1273 } 1273 }
1274 1274
1275 } // namespace app_controller_mac 1275 } // namespace app_controller_mac
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/chrome_download_manager_delegate.h » ('j') | content/browser/download/download_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698