| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 if (UserScript::HasUserScriptFileExtension(download_item.url())) { | 247 if (UserScript::HasUserScriptFileExtension(download_item.url())) { |
| 248 installer->InstallUserScript(download_item.full_path(), | 248 installer->InstallUserScript(download_item.full_path(), |
| 249 download_item.url()); | 249 download_item.url()); |
| 250 return; | 250 return; |
| 251 } | 251 } |
| 252 | 252 |
| 253 bool is_gallery_download = service->IsDownloadFromGallery( | 253 bool is_gallery_download = service->IsDownloadFromGallery( |
| 254 download_item.url(), download_item.referrer_url()); | 254 download_item.url(), download_item.referrer_url()); |
| 255 installer->set_original_mime_type(download_item.original_mime_type()); | 255 installer->set_original_mime_type(download_item.original_mime_type()); |
| 256 installer->set_apps_require_extension_mime_type(true); | 256 installer->set_apps_require_extension_mime_type(true); |
| 257 installer->set_allow_privilege_increase(true); | 257 installer->set_allow_privilege_increase(false); |
| 258 installer->set_original_url(download_item.url()); | 258 installer->set_original_url(download_item.url()); |
| 259 installer->set_is_gallery_install(is_gallery_download); | 259 installer->set_is_gallery_install(is_gallery_download); |
| 260 installer->InstallCrx(download_item.full_path()); | 260 installer->InstallCrx(download_item.full_path()); |
| 261 installer->set_allow_silent_install(is_gallery_download); | 261 installer->set_allow_silent_install(is_gallery_download); |
| 262 } | 262 } |
| 263 | 263 |
| 264 // Download progress painting -------------------------------------------------- | 264 // Download progress painting -------------------------------------------------- |
| 265 | 265 |
| 266 // Common bitmaps used for download progress animations. We load them once the | 266 // Common bitmaps used for download progress animations. We load them once the |
| 267 // first time we do a progress paint, then reuse them as they are always the | 267 // first time we do a progress paint, then reuse them as they are always the |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 ExtensionsService* service = profile->GetExtensionsService(); | 741 ExtensionsService* service = profile->GetExtensionsService(); |
| 742 if (!service || | 742 if (!service || |
| 743 !service->IsDownloadFromGallery(info->url, info->referrer_url)) { | 743 !service->IsDownloadFromGallery(info->url, info->referrer_url)) { |
| 744 return true; | 744 return true; |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 return false; | 747 return false; |
| 748 } | 748 } |
| 749 | 749 |
| 750 } // namespace download_util | 750 } // namespace download_util |
| OLD | NEW |