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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 | 185 |
186 ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { | 186 ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { |
187 // If a DownloadManager was set for this, Shutdown() must be called. | 187 // If a DownloadManager was set for this, Shutdown() must be called. |
188 DCHECK(!download_manager_); | 188 DCHECK(!download_manager_); |
189 } | 189 } |
190 | 190 |
191 void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) { | 191 void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) { |
192 download_manager_ = dm; | 192 download_manager_ = dm; |
193 | 193 |
194 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | |
195 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); | 194 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); |
196 if (sb_service && !profile_->IsOffTheRecord()) { | 195 if (sb_service && !profile_->IsOffTheRecord()) { |
197 // Include this download manager in the set monitored by safe browsing. | 196 // Include this download manager in the set monitored by safe browsing. |
198 sb_service->AddDownloadManager(dm); | 197 sb_service->AddDownloadManager(dm); |
199 } | 198 } |
200 #endif | |
201 } | 199 } |
202 | 200 |
203 void ChromeDownloadManagerDelegate::Shutdown() { | 201 void ChromeDownloadManagerDelegate::Shutdown() { |
204 download_prefs_.reset(); | 202 download_prefs_.reset(); |
205 weak_ptr_factory_.InvalidateWeakPtrs(); | 203 weak_ptr_factory_.InvalidateWeakPtrs(); |
206 download_manager_ = NULL; | 204 download_manager_ = NULL; |
207 } | 205 } |
208 | 206 |
209 content::DownloadIdCallback | 207 content::DownloadIdCallback |
210 ChromeDownloadManagerDelegate::GetDownloadIdReceiverCallback() { | 208 ChromeDownloadManagerDelegate::GetDownloadIdReceiverCallback() { |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 750 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
753 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 751 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
754 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 752 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
755 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 753 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
756 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 754 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
757 return true; | 755 return true; |
758 } | 756 } |
759 #endif | 757 #endif |
760 return false; | 758 return false; |
761 } | 759 } |
OLD | NEW |