#include "chrome/browser/download/save_package_file_picker.h"
#include "chrome/browser/extensions/api/downloads/downloads_api.h"
#include "chrome/browser/extensions/crx_installer.h"
+#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/page_navigator.h"
#include "extensions/common/constants.h"
+#include "net/base/filename_util.h"
#include "net/base/mime_util.h"
-#include "net/base/net_util.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/drive/download_handler.h"
path.MatchesExtension(FILE_PATH_LITERAL(".xht")) ||
path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) ||
path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".xml")) ||
path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) ||
path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) {
return true;
bool ChromeDownloadManagerDelegate::ShouldOpenDownload(
DownloadItem* item, const content::DownloadOpenDelayedCallback& callback) {
- if (download_crx_util::IsExtensionDownload(*item)) {
+ if (download_crx_util::IsExtensionDownload(*item) &&
+ !extensions::WebstoreInstaller::GetAssociatedApproval(*item)) {
scoped_refptr<extensions::CrxInstaller> crx_installer =
download_crx_util::OpenChromeExtension(profile_, *item);
const NotifyExtensionsCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
#if !defined(OS_ANDROID)
- ExtensionDownloadsEventRouter* router =
- DownloadServiceFactory::GetForBrowserContext(profile_)->
- GetExtensionEventRouter();
+ extensions::ExtensionDownloadsEventRouter* router =
+ DownloadServiceFactory::GetForBrowserContext(profile_)
+ ->GetExtensionEventRouter();
if (router) {
base::Closure original_path_callback =
base::Bind(callback, base::FilePath(),