#include "chrome/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.h"
#include <cmath>
#include "base/memory/weak_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/pdf/pdf_pref_names.h"
#include "chrome/browser/pdf/pdf_viewer_stream_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/pdf_viewer_private.h"
#include "chrome/common/pref_names.h"
#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 "url/url_constants.h"
namespace extensions {
namespace {
IsAllowedLocalFileAccess;
SetPdfPluginAttributes;
SetPdfDocumentTitle;
bool IsUrlAllowedToEmbedLocalFiles(
const GURL& current_url,
const base::Value::List& allowlisted_domains) { … }
base::WeakPtr<StreamContainer> GetStreamContainer(
content::RenderFrameHost* extension_host) { … }
}
PdfViewerPrivateGetStreamInfoFunction::PdfViewerPrivateGetStreamInfoFunction() =
default;
PdfViewerPrivateGetStreamInfoFunction::
~PdfViewerPrivateGetStreamInfoFunction() = default;
ExtensionFunction::ResponseAction PdfViewerPrivateGetStreamInfoFunction::Run() { … }
PdfViewerPrivateIsAllowedLocalFileAccessFunction::
PdfViewerPrivateIsAllowedLocalFileAccessFunction() = default;
PdfViewerPrivateIsAllowedLocalFileAccessFunction::
~PdfViewerPrivateIsAllowedLocalFileAccessFunction() = default;
ExtensionFunction::ResponseAction
PdfViewerPrivateIsAllowedLocalFileAccessFunction::Run() { … }
PdfViewerPrivateSetPdfDocumentTitleFunction::
PdfViewerPrivateSetPdfDocumentTitleFunction() = default;
PdfViewerPrivateSetPdfDocumentTitleFunction::
~PdfViewerPrivateSetPdfDocumentTitleFunction() = default;
ExtensionFunction::ResponseAction
PdfViewerPrivateSetPdfDocumentTitleFunction::Run() { … }
PdfViewerPrivateSetPdfPluginAttributesFunction::
PdfViewerPrivateSetPdfPluginAttributesFunction() = default;
PdfViewerPrivateSetPdfPluginAttributesFunction::
~PdfViewerPrivateSetPdfPluginAttributesFunction() = default;
ExtensionFunction::ResponseAction
PdfViewerPrivateSetPdfPluginAttributesFunction::Run() { … }
}