-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chrome: Add CefDownloadHandler support (see #3681)
Behaves the same as Alloy runtime except that CanDownload is not called for invalid protocol schemes.
- Loading branch information
1 parent
ed07979
commit be6642d
Showing
23 changed files
with
873 additions
and
616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// 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. | ||
|
||
#include "libcef/browser/alloy/alloy_download_manager_delegate.h" | ||
|
||
#include "chrome/common/chrome_constants.h" | ||
#include "components/download/public/common/download_item.h" | ||
|
||
AlloyDownloadManagerDelegate::AlloyDownloadManagerDelegate( | ||
content::DownloadManager* manager) | ||
: CefDownloadManagerDelegateImpl(manager, /*alloy_bootstrap=*/true) {} | ||
|
||
void AlloyDownloadManagerDelegate::GetNextId( | ||
content::DownloadIdCallback callback) { | ||
static uint32_t next_id = download::DownloadItem::kInvalidId + 1; | ||
std::move(callback).Run(next_id++); | ||
} | ||
|
||
std::string AlloyDownloadManagerDelegate::ApplicationClientIdForFileScanning() { | ||
return std::string(chrome::kApplicationClientIDStringForAVScanning); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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. | ||
|
||
#ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_MANAGER_DELEGATE_H_ | ||
#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_MANAGER_DELEGATE_H_ | ||
#pragma once | ||
|
||
#include "libcef/browser/download_manager_delegate_impl.h" | ||
|
||
// Specialization for the Alloy bootstrap. | ||
class AlloyDownloadManagerDelegate : public CefDownloadManagerDelegateImpl { | ||
public: | ||
explicit AlloyDownloadManagerDelegate(content::DownloadManager* manager); | ||
|
||
AlloyDownloadManagerDelegate(const AlloyDownloadManagerDelegate&) = delete; | ||
AlloyDownloadManagerDelegate& operator=(const AlloyDownloadManagerDelegate&) = | ||
delete; | ||
|
||
private: | ||
// DownloadManagerDelegate methods. | ||
void GetNextId(content::DownloadIdCallback callback) override; | ||
std::string ApplicationClientIdForFileScanning() override; | ||
}; | ||
|
||
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_MANAGER_DELEGATE_H_ |
Oops, something went wrong.