| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Download utility implementation | 5 // Download utility implementation |
| 6 | 6 |
| 7 #include "chrome/browser/download/download_util.h" | 7 #include "chrome/browser/download/download_util.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <shobjidl.h> | 10 #include <shobjidl.h> |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 if (UserScript::HasUserScriptFileExtension(download_item.url())) { | 245 if (UserScript::HasUserScriptFileExtension(download_item.url())) { |
| 246 installer->InstallUserScript(download_item.full_path(), | 246 installer->InstallUserScript(download_item.full_path(), |
| 247 download_item.url()); | 247 download_item.url()); |
| 248 return; | 248 return; |
| 249 } | 249 } |
| 250 | 250 |
| 251 bool is_gallery_download = service->IsDownloadFromGallery( | 251 bool is_gallery_download = service->IsDownloadFromGallery( |
| 252 download_item.url(), download_item.referrer_url()); | 252 download_item.url(), download_item.referrer_url()); |
| 253 installer->set_original_mime_type(download_item.original_mime_type()); | 253 installer->set_original_mime_type(download_item.original_mime_type()); |
| 254 installer->set_apps_require_extension_mime_type(true); | 254 installer->set_apps_require_extension_mime_type(true); |
| 255 installer->set_allow_privilege_increase(true); | |
| 256 installer->set_original_url(download_item.url()); | 255 installer->set_original_url(download_item.url()); |
| 257 installer->set_is_gallery_install(is_gallery_download); | 256 installer->set_is_gallery_install(is_gallery_download); |
| 258 installer->InstallCrx(download_item.full_path()); | 257 installer->InstallCrx(download_item.full_path()); |
| 259 installer->set_allow_silent_install(is_gallery_download); | 258 installer->set_allow_silent_install(is_gallery_download); |
| 260 } | 259 } |
| 261 | 260 |
| 262 // Download progress painting -------------------------------------------------- | 261 // Download progress painting -------------------------------------------------- |
| 263 | 262 |
| 264 // Common bitmaps used for download progress animations. We load them once the | 263 // Common bitmaps used for download progress animations. We load them once the |
| 265 // first time we do a progress paint, then reuse them as they are always the | 264 // first time we do a progress paint, then reuse them as they are always the |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 ExtensionsService* service = profile->GetExtensionsService(); | 730 ExtensionsService* service = profile->GetExtensionsService(); |
| 732 if (!service || | 731 if (!service || |
| 733 !service->IsDownloadFromGallery(info->url, info->referrer_url)) { | 732 !service->IsDownloadFromGallery(info->url, info->referrer_url)) { |
| 734 return true; | 733 return true; |
| 735 } | 734 } |
| 736 } | 735 } |
| 737 return false; | 736 return false; |
| 738 } | 737 } |
| 739 | 738 |
| 740 } // namespace download_util | 739 } // namespace download_util |
| OLD | NEW |