Browse Source

5596349: Remove PDF OCR toggle from settings.

https://chromium-review.googlesource.com/c/chromium/src/+/5596349
John Kleinschmidt 10 months ago
parent
commit
00c7468c54

+ 0 - 28
shell/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.cc

@@ -26,8 +26,6 @@ namespace {
 namespace IsAllowedLocalFileAccess =
     api::pdf_viewer_private::IsAllowedLocalFileAccess;
 
-namespace SetPdfOcrPref = api::pdf_viewer_private::SetPdfOcrPref;
-
 namespace SetPdfPluginAttributes =
     api::pdf_viewer_private::SetPdfPluginAttributes;
 
@@ -141,32 +139,6 @@ PdfViewerPrivateSetPdfDocumentTitleFunction::Run() {
   return RespondNow(NoArguments());
 }
 
-PdfViewerPrivateIsPdfOcrAlwaysActiveFunction::
-    PdfViewerPrivateIsPdfOcrAlwaysActiveFunction() = default;
-
-PdfViewerPrivateIsPdfOcrAlwaysActiveFunction::
-    ~PdfViewerPrivateIsPdfOcrAlwaysActiveFunction() = default;
-
-// TODO(codebytere): enable when https://crbug.com/1393069 works properly.
-ExtensionFunction::ResponseAction
-PdfViewerPrivateIsPdfOcrAlwaysActiveFunction::Run() {
-  return RespondNow(WithArguments(false));
-}
-
-PdfViewerPrivateSetPdfOcrPrefFunction::PdfViewerPrivateSetPdfOcrPrefFunction() =
-    default;
-
-PdfViewerPrivateSetPdfOcrPrefFunction::
-    ~PdfViewerPrivateSetPdfOcrPrefFunction() = default;
-
-// TODO(codebytere): enable when https://crbug.com/1393069 works properly.
-ExtensionFunction::ResponseAction PdfViewerPrivateSetPdfOcrPrefFunction::Run() {
-  std::optional<SetPdfOcrPref::Params> params =
-      SetPdfOcrPref::Params::Create(args());
-  EXTENSION_FUNCTION_VALIDATE(params);
-  return RespondNow(WithArguments(false));
-}
-
 PdfViewerPrivateSetPdfPluginAttributesFunction::
     PdfViewerPrivateSetPdfPluginAttributesFunction() = default;
 

+ 0 - 36
shell/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.h

@@ -64,42 +64,6 @@ class PdfViewerPrivateSetPdfDocumentTitleFunction : public ExtensionFunction {
   ResponseAction Run() override;
 };
 
-class PdfViewerPrivateIsPdfOcrAlwaysActiveFunction : public ExtensionFunction {
- public:
-  DECLARE_EXTENSION_FUNCTION("pdfViewerPrivate.isPdfOcrAlwaysActive",
-                             PDFVIEWERPRIVATE_ISPDFOCRALWAYSACTIVE)
-
-  PdfViewerPrivateIsPdfOcrAlwaysActiveFunction();
-  PdfViewerPrivateIsPdfOcrAlwaysActiveFunction(
-      const PdfViewerPrivateIsPdfOcrAlwaysActiveFunction&) = delete;
-  PdfViewerPrivateIsPdfOcrAlwaysActiveFunction& operator=(
-      const PdfViewerPrivateIsPdfOcrAlwaysActiveFunction&) = delete;
-
- protected:
-  ~PdfViewerPrivateIsPdfOcrAlwaysActiveFunction() override;
-
-  // Override from ExtensionFunction:
-  ResponseAction Run() override;
-};
-
-class PdfViewerPrivateSetPdfOcrPrefFunction : public ExtensionFunction {
- public:
-  DECLARE_EXTENSION_FUNCTION("pdfViewerPrivate.setPdfOcrPref",
-                             PDFVIEWERPRIVATE_SETPDFOCRPREF)
-
-  PdfViewerPrivateSetPdfOcrPrefFunction();
-  PdfViewerPrivateSetPdfOcrPrefFunction(
-      const PdfViewerPrivateSetPdfOcrPrefFunction&) = delete;
-  PdfViewerPrivateSetPdfOcrPrefFunction& operator=(
-      const PdfViewerPrivateSetPdfOcrPrefFunction&) = delete;
-
- protected:
-  ~PdfViewerPrivateSetPdfOcrPrefFunction() override;
-
-  // Override from ExtensionFunction:
-  ResponseAction Run() override;
-};
-
 class PdfViewerPrivateSetPdfPluginAttributesFunction
     : public ExtensionFunction {
  public:

+ 0 - 18
shell/common/extensions/api/pdf_viewer_private.idl

@@ -38,8 +38,6 @@ namespace pdfViewerPrivate {
 
   callback GetStreamInfoCallback = void(StreamInfo streamInfo);
   callback IsAllowedLocalFileAccessCallback = void(boolean result);
-  callback IsPdfOcrAlwaysActiveCallback = void(boolean result);
-  callback OnPdfOcrPrefSetCallback = void(boolean result);
   callback VoidCallback = void();
 
   interface Functions {
@@ -54,23 +52,11 @@ namespace pdfViewerPrivate {
         DOMString url,
         IsAllowedLocalFileAccessCallback callback);
 
-    // Determines if the preference for PDF OCR is set to run PDF OCR always.
-    // |callback|: Called with true if PDF OCR is set to be always active;
-    // false otherwise.
-    static void isPdfOcrAlwaysActive(
-        IsPdfOcrAlwaysActiveCallback callback);
-
     // Sets the current tab title to `title` for a full-page PDF.
     static void setPdfDocumentTitle(
         DOMString title,
         optional VoidCallback callback);
 
-    // Sets a pref value for PDF OCR.
-    // |value|: The new value of the pref.
-    // |callback|: The callback for whether the pref was set or not.
-    static void setPdfOcrPref(
-        boolean value, OnPdfOcrPrefSetCallback callback);
-
     // Sets PDF plugin attributes in the stream for this context if there is
     // one.
     static void setPdfPluginAttributes(
@@ -79,10 +65,6 @@ namespace pdfViewerPrivate {
   };
 
   interface Events {
-    // Fired when a pref value for PDF OCR has changed.
-    // |value| The pref value that changed.
-    static void onPdfOcrPrefChanged(boolean value);
-
     // Fired when the browser wants the listener to perform a save.
     // `streamUrl`: Unique ID for the instance that should perform the save.
     static void onSave(DOMString streamUrl);