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

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

Issue 26938003: Don't prompt to save malicious downloads on exit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unneeded code Created 7 years, 2 months 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
« no previous file with comments | « no previous file | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "apps/app_shim/app_shim_mac.h" 7 #include "apps/app_shim/app_shim_mac.h"
8 #include "apps/app_shim/extension_app_shim_handler_mac.h" 8 #include "apps/app_shim/extension_app_shim_handler_mac.h"
9 #include "apps/shell_window_registry.h" 9 #include "apps/shell_window_registry.h"
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 if (!profile_manager) 753 if (!profile_manager)
754 return YES; 754 return YES;
755 755
756 std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles()); 756 std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles());
757 for (size_t i = 0; i < profiles.size(); ++i) { 757 for (size_t i = 0; i < profiles.size(); ++i) {
758 DownloadService* download_service = 758 DownloadService* download_service =
759 DownloadServiceFactory::GetForBrowserContext(profiles[i]); 759 DownloadServiceFactory::GetForBrowserContext(profiles[i]);
760 DownloadManager* download_manager = 760 DownloadManager* download_manager =
761 (download_service->HasCreatedDownloadManager() ? 761 (download_service->HasCreatedDownloadManager() ?
762 BrowserContext::GetDownloadManager(profiles[i]) : NULL); 762 BrowserContext::GetDownloadManager(profiles[i]) : NULL);
763 if (download_manager && download_manager->InProgressCount() > 0) { 763 if (download_manager &&
764 int downloadCount = download_manager->InProgressCount(); 764 download_manager->NonMaliciousInProgressCount() > 0) {
765 int downloadCount = download_manager->NonMaliciousInProgressCount();
765 if ([self userWillWaitForInProgressDownloads:downloadCount]) { 766 if ([self userWillWaitForInProgressDownloads:downloadCount]) {
766 // Create a new browser window (if necessary) and navigate to the 767 // Create a new browser window (if necessary) and navigate to the
767 // downloads page if the user chooses to wait. 768 // downloads page if the user chooses to wait.
768 Browser* browser = chrome::FindBrowserWithProfile( 769 Browser* browser = chrome::FindBrowserWithProfile(
769 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE); 770 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE);
770 if (!browser) { 771 if (!browser) {
771 browser = new Browser(Browser::CreateParams( 772 browser = new Browser(Browser::CreateParams(
772 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE)); 773 profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE));
773 browser->window()->Show(); 774 browser->window()->Show();
774 } 775 }
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 1423
1423 //--------------------------------------------------------------------------- 1424 //---------------------------------------------------------------------------
1424 1425
1425 namespace app_controller_mac { 1426 namespace app_controller_mac {
1426 1427
1427 bool IsOpeningNewWindow() { 1428 bool IsOpeningNewWindow() {
1428 return g_is_opening_new_window; 1429 return g_is_opening_new_window;
1429 } 1430 }
1430 1431
1431 } // namespace app_controller_mac 1432 } // namespace app_controller_mac
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698