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 // Download code which handles CRX files (extensions, themes, apps, ...). | 5 // Download code which handles CRX files (extensions, themes, apps, ...). |
6 | 6 |
7 #include "chrome/browser/download/download_crx_util.h" | 7 #include "chrome/browser/download/download_crx_util.h" |
8 #include "chrome/browser/extensions/crx_installer.h" | |
9 #include "chrome/browser/profiles/profile.h" | |
10 #include "content/public/browser/download_item.h" | |
11 | |
12 using content::BrowserThread; | |
13 using content::DownloadItem; | |
14 | 8 |
15 namespace download_crx_util { | 9 namespace download_crx_util { |
16 | 10 |
17 scoped_refptr<extensions::CrxInstaller> CreateCrxInstaller( | 11 bool IsExtensionDownload(const content::DownloadItem& download_item) { |
18 Profile* profile, | |
19 const content::DownloadItem& download_item) { | |
20 NOTIMPLEMENTED() << "CrxInstaller not implemented on Android"; | |
21 scoped_refptr<extensions::CrxInstaller> installer( | |
22 extensions::CrxInstaller::CreateSilent(NULL)); | |
23 return installer; | |
24 } | |
25 | |
26 void SetMockInstallPromptForTesting(ExtensionInstallPrompt* mock_prompt) { | |
27 NOTIMPLEMENTED(); | |
28 } | |
29 | |
30 scoped_refptr<extensions::CrxInstaller> OpenChromeExtension( | |
31 Profile* profile, | |
32 const DownloadItem& download_item) { | |
33 NOTIMPLEMENTED() << "CrxInstaller not implemented on Android"; | |
34 scoped_refptr<extensions::CrxInstaller> installer( | |
35 extensions::CrxInstaller::CreateSilent(NULL)); | |
36 return installer; | |
37 } | |
38 | |
39 bool IsExtensionDownload(const DownloadItem& download_item) { | |
40 // Extensions are not supported on Android. We want to treat them as | 12 // Extensions are not supported on Android. We want to treat them as |
41 // normal file downloads. | 13 // normal file downloads. |
42 return false; | 14 return false; |
43 } | 15 } |
44 | 16 |
45 bool OffStoreInstallAllowedByPrefs(Profile* profile, | 17 bool OffStoreInstallAllowedByPrefs(Profile* profile, |
46 const content::DownloadItem& item) { | 18 const content::DownloadItem& item) { |
47 // Extensions are not supported on Android, return the safe default. | 19 // Extensions are not supported on Android, return the safe default. |
48 return false; | 20 return false; |
49 } | 21 } |
50 | 22 |
51 } // namespace download_crx_util | 23 } // namespace download_crx_util |
OLD | NEW |