summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_crx_util_android.cc
blob: 76c9d8120e1181acc55ebcd974f389da03ac1c90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Download code which handles CRX files (extensions, themes, apps, ...).

#include "chrome/browser/download/download_crx_util.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/download_item.h"

using content::BrowserThread;
using content::DownloadItem;

namespace download_crx_util {

scoped_refptr<extensions::CrxInstaller> CreateCrxInstaller(
    Profile* profile,
    const content::DownloadItem& download_item) {
  NOTIMPLEMENTED() << "CrxInstaller not implemented on Android";
  scoped_refptr<extensions::CrxInstaller> installer(
      extensions::CrxInstaller::CreateSilent(NULL));
  return installer;
}

void SetMockInstallPromptForTesting(ExtensionInstallPrompt* mock_prompt) {
  NOTIMPLEMENTED();
}

scoped_refptr<extensions::CrxInstaller> OpenChromeExtension(
    Profile* profile,
    const DownloadItem& download_item) {
  NOTIMPLEMENTED() << "CrxInstaller not implemented on Android";
  scoped_refptr<extensions::CrxInstaller> installer(
      extensions::CrxInstaller::CreateSilent(NULL));
  return installer;
}

bool IsExtensionDownload(const DownloadItem& download_item) {
  // Extensions are not supported on Android. We want to treat them as
  // normal file downloads.
  return false;
}

bool OffStoreInstallAllowedByPrefs(Profile* profile,
                                   const content::DownloadItem& item) {
  // Extensions are not supported on Android, return the safe default.
  return false;
}

}  // namespace download_crx_util