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

Side by Side Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 257983002: Move downloads API to extensions namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error for unittest Created 6 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/download/download_history.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 #include "chrome/browser/download/chrome_download_manager_delegate.h" 5 #include "chrome/browser/download/chrome_download_manager_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 #endif 529 #endif
530 return NULL; 530 return NULL;
531 } 531 }
532 532
533 void ChromeDownloadManagerDelegate::NotifyExtensions( 533 void ChromeDownloadManagerDelegate::NotifyExtensions(
534 DownloadItem* download, 534 DownloadItem* download,
535 const base::FilePath& virtual_path, 535 const base::FilePath& virtual_path,
536 const NotifyExtensionsCallback& callback) { 536 const NotifyExtensionsCallback& callback) {
537 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 537 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
538 #if !defined(OS_ANDROID) 538 #if !defined(OS_ANDROID)
539 ExtensionDownloadsEventRouter* router = 539 extensions::ExtensionDownloadsEventRouter* router =
540 DownloadServiceFactory::GetForBrowserContext(profile_)-> 540 DownloadServiceFactory::GetForBrowserContext(profile_)
541 GetExtensionEventRouter(); 541 ->GetExtensionEventRouter();
542 if (router) { 542 if (router) {
543 base::Closure original_path_callback = 543 base::Closure original_path_callback =
544 base::Bind(callback, base::FilePath(), 544 base::Bind(callback, base::FilePath(),
545 DownloadPathReservationTracker::UNIQUIFY); 545 DownloadPathReservationTracker::UNIQUIFY);
546 router->OnDeterminingFilename(download, virtual_path.BaseName(), 546 router->OnDeterminingFilename(download, virtual_path.BaseName(),
547 original_path_callback, 547 original_path_callback,
548 callback); 548 callback);
549 return; 549 return;
550 } 550 }
551 #endif 551 #endif
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 DownloadItem* item = download_manager_->GetDownload(download_id); 706 DownloadItem* item = download_manager_->GetDownload(download_id);
707 if (!target_info->target_path.empty() && item && 707 if (!target_info->target_path.empty() && item &&
708 IsOpenInBrowserPreferreredForFile(target_info->target_path) && 708 IsOpenInBrowserPreferreredForFile(target_info->target_path) &&
709 target_info->is_filetype_handled_safely) 709 target_info->is_filetype_handled_safely)
710 DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); 710 DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
711 callback.Run(target_info->target_path, 711 callback.Run(target_info->target_path,
712 target_info->target_disposition, 712 target_info->target_disposition,
713 target_info->danger_type, 713 target_info->danger_type,
714 target_info->intermediate_path); 714 target_info->intermediate_path);
715 } 715 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698