[OOPIF PDF] Create enterprise policy PdfViewerOutOfProcessIframeEnabled

Introduce an enterprise policy that can enable or disable OOPIF PDF.
Note that OOPIF PDF viewer is only enabled when the policy is enabled
and the kPdfOopif feature flag is enabled, otherwise the existing
GuestView PDF viewer will be used.

The policy does not support dynamic_refresh. If it was supported, then
the browser would be able to have instances of GuestView PDF and OOPIF
PDF simultaneously, which could lead to unexpected behavior. They
aren't meant to run at the same time.

If the policy hasn't been set, then by default, the policy will be
enabled. Otherwise, embedders would crash if they didn't set the policy.

Bug: 324637002
Change-Id: I0e0216d1bd5dbdc14f4dd6e3461aa4dc72360c55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5450113
Reviewed-by: Owen Min <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Commit-Queue: Andy Phan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1290238}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index f9c4452..1e6aed1 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1789,6 +1789,11 @@
   registry->RegisterBooleanPref(prefs::kOopPrintDriversAllowedByPolicy, true);
 #endif
 
+#if BUILDFLAG(ENABLE_PDF)
+  registry->RegisterBooleanPref(prefs::kPdfViewerOutOfProcessIframeEnabled,
+                                true);
+#endif  // BUILDFLAG(ENABLE_PDF)
+
 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
   registry->RegisterBooleanPref(prefs::kChromeForTestingAllowed, true);
 #endif