fix: add missed enum SaveRequestType to PdfViewerPrivate function (#48409)
fix: add missed SaveRequestType enum to PdfViewerPrivate function Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
This commit is contained in:
parent
074d0e19fb
commit
6dc3923b93
4 changed files with 58 additions and 0 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include "components/pdf/common/constants.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
|
||||
#include "pdf/buildflags.h"
|
||||
#include "url/url_constants.h"
|
||||
|
||||
namespace extensions {
|
||||
|
|
@ -25,6 +26,8 @@ namespace {
|
|||
namespace IsAllowedLocalFileAccess =
|
||||
api::pdf_viewer_private::IsAllowedLocalFileAccess;
|
||||
|
||||
namespace SaveToDrive = api::pdf_viewer_private::SaveToDrive;
|
||||
|
||||
namespace SetPdfPluginAttributes =
|
||||
api::pdf_viewer_private::SetPdfPluginAttributes;
|
||||
|
||||
|
|
@ -107,6 +110,24 @@ PdfViewerPrivateIsAllowedLocalFileAccessFunction::Run() {
|
|||
IsUrlAllowedToEmbedLocalFiles(GURL(params->url), base::Value::List())));
|
||||
}
|
||||
|
||||
PdfViewerPrivateSaveToDriveFunction::PdfViewerPrivateSaveToDriveFunction() =
|
||||
default;
|
||||
|
||||
PdfViewerPrivateSaveToDriveFunction::~PdfViewerPrivateSaveToDriveFunction() =
|
||||
default;
|
||||
|
||||
ExtensionFunction::ResponseAction PdfViewerPrivateSaveToDriveFunction::Run() {
|
||||
#if BUILDFLAG(ENABLE_PDF_SAVE_TO_DRIVE)
|
||||
std::optional<SaveToDrive::Params> params =
|
||||
SaveToDrive::Params::Create(args());
|
||||
EXTENSION_FUNCTION_VALIDATE(params);
|
||||
// TODO(crbug.com/424208776): Start the save to drive flow.
|
||||
return RespondNow(NoArguments());
|
||||
#else
|
||||
return RespondNow(Error("Not supported"));
|
||||
#endif // BUILDFLAG(ENABLE_PDF_SAVE_TO_DRIVE)
|
||||
}
|
||||
|
||||
PdfViewerPrivateSetPdfDocumentTitleFunction::
|
||||
PdfViewerPrivateSetPdfDocumentTitleFunction() = default;
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,24 @@ class PdfViewerPrivateIsAllowedLocalFileAccessFunction
|
|||
ResponseAction Run() override;
|
||||
};
|
||||
|
||||
class PdfViewerPrivateSaveToDriveFunction : public ExtensionFunction {
|
||||
public:
|
||||
DECLARE_EXTENSION_FUNCTION("pdfViewerPrivate.saveToDrive",
|
||||
PDFVIEWERPRIVATE_SAVETODRIVE)
|
||||
|
||||
PdfViewerPrivateSaveToDriveFunction();
|
||||
PdfViewerPrivateSaveToDriveFunction(
|
||||
const PdfViewerPrivateSaveToDriveFunction&) = delete;
|
||||
PdfViewerPrivateSaveToDriveFunction& operator=(
|
||||
const PdfViewerPrivateSaveToDriveFunction&) = delete;
|
||||
|
||||
protected:
|
||||
~PdfViewerPrivateSaveToDriveFunction() override;
|
||||
|
||||
// Override from ExtensionFunction:
|
||||
ResponseAction Run() override;
|
||||
};
|
||||
|
||||
class PdfViewerPrivateSetPdfDocumentTitleFunction : public ExtensionFunction {
|
||||
public:
|
||||
DECLARE_EXTENSION_FUNCTION("pdfViewerPrivate.setPdfDocumentTitle",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue