| 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 #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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 weak_ptr_factory_(this) { | 178 weak_ptr_factory_(this) { |
| 179 } | 179 } |
| 180 | 180 |
| 181 ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { | 181 ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { |
| 182 // If a DownloadManager was set for this, Shutdown() must be called. | 182 // If a DownloadManager was set for this, Shutdown() must be called. |
| 183 DCHECK(!download_manager_); | 183 DCHECK(!download_manager_); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) { | 186 void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) { |
| 187 download_manager_ = dm; | 187 download_manager_ = dm; |
| 188 |
| 189 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) |
| 190 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); |
| 191 if (sb_service && !profile_->IsOffTheRecord()) { |
| 192 // Include this download manager in the set monitored by safe browsing. |
| 193 sb_service->AddDownloadManager(dm); |
| 194 } |
| 195 #endif |
| 188 } | 196 } |
| 189 | 197 |
| 190 void ChromeDownloadManagerDelegate::Shutdown() { | 198 void ChromeDownloadManagerDelegate::Shutdown() { |
| 191 download_prefs_.reset(); | 199 download_prefs_.reset(); |
| 192 weak_ptr_factory_.InvalidateWeakPtrs(); | 200 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 193 download_manager_ = NULL; | 201 download_manager_ = NULL; |
| 194 } | 202 } |
| 195 | 203 |
| 196 content::DownloadIdCallback | 204 content::DownloadIdCallback |
| 197 ChromeDownloadManagerDelegate::GetDownloadIdReceiverCallback() { | 205 ChromeDownloadManagerDelegate::GetDownloadIdReceiverCallback() { |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 741 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
| 734 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 742 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
| 735 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 743 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
| 736 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 744 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
| 737 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 745 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
| 738 return true; | 746 return true; |
| 739 } | 747 } |
| 740 #endif | 748 #endif |
| 741 return false; | 749 return false; |
| 742 } | 750 } |
| OLD | NEW |