| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 state->CompleteDownload(); | 705 state->CompleteDownload(); |
| 706 } | 706 } |
| 707 #endif // FULL_SAFE_BROWSING | 707 #endif // FULL_SAFE_BROWSING |
| 708 | 708 |
| 709 // content::NotificationObserver implementation. | 709 // content::NotificationObserver implementation. |
| 710 void ChromeDownloadManagerDelegate::Observe( | 710 void ChromeDownloadManagerDelegate::Observe( |
| 711 int type, | 711 int type, |
| 712 const content::NotificationSource& source, | 712 const content::NotificationSource& source, |
| 713 const content::NotificationDetails& details) { | 713 const content::NotificationDetails& details) { |
| 714 #if defined(ENABLE_EXTENSIONS) | 714 #if defined(ENABLE_EXTENSIONS) |
| 715 DCHECK(type == extensions::NOTIFICATION_CRX_INSTALLER_DONE); | 715 DCHECK_EQ(extensions::NOTIFICATION_CRX_INSTALLER_DONE, type); |
| 716 | 716 |
| 717 registrar_.Remove(this, extensions::NOTIFICATION_CRX_INSTALLER_DONE, source); | 717 registrar_.Remove(this, extensions::NOTIFICATION_CRX_INSTALLER_DONE, source); |
| 718 | 718 |
| 719 scoped_refptr<extensions::CrxInstaller> installer = | 719 scoped_refptr<extensions::CrxInstaller> installer = |
| 720 content::Source<extensions::CrxInstaller>(source).ptr(); | 720 content::Source<extensions::CrxInstaller>(source).ptr(); |
| 721 content::DownloadOpenDelayedCallback callback = | 721 content::DownloadOpenDelayedCallback callback = |
| 722 crx_installers_[installer.get()]; | 722 crx_installers_[installer.get()]; |
| 723 crx_installers_.erase(installer.get()); | 723 crx_installers_.erase(installer.get()); |
| 724 callback.Run(installer->did_handle_successfully()); | 724 callback.Run(installer->did_handle_successfully()); |
| 725 #endif | 725 #endif |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 772 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
| 773 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 773 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
| 774 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 774 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
| 775 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 775 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
| 776 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 776 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
| 777 return true; | 777 return true; |
| 778 } | 778 } |
| 779 #endif | 779 #endif |
| 780 return false; | 780 return false; |
| 781 } | 781 } |
| OLD | NEW |