Commit b0aab7e1 authored by dpapad's avatar dpapad Committed by Chromium LUCI CQ

PDF Viewer: Stop respecting the PDFViewerUpdate flag.

 - In the frontend, hardcode the pdf-viewer-update-enabled attribute.
   Previously present/absent based on the state of the flag.
 - In the backend, remove checks for
   base::FeatureList::IsEnabled(features::kPDFViewerUpdate)

As a result of these changes --disable-features=PDFViewerUpdate no
longer works, in the sense that even if specified it will show the
new UI. Newly dead code (old UI) will be removed in follow up CLs.

Bug: 1164004
Change-Id: I0321f2f22e1358c69f6dc5d5c2662739e0b7ead7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2638992
Commit-Queue: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Reviewed-by: default avatarK. Moon <kmoon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845578}
parent cab1e31b
...@@ -193,11 +193,6 @@ void AddAdditionalData(base::Value* dict) { ...@@ -193,11 +193,6 @@ void AddAdditionalData(base::Value* dict) {
dict->SetKey("pdfFormSaveEnabled", dict->SetKey("pdfFormSaveEnabled",
base::Value(base::FeatureList::IsEnabled( base::Value(base::FeatureList::IsEnabled(
chrome_pdf::features::kSaveEditedPDFForm))); chrome_pdf::features::kSaveEditedPDFForm)));
dict->SetStringKey(
"pdfViewerUpdateEnabledAttribute",
base::FeatureList::IsEnabled(chrome_pdf::features::kPDFViewerUpdate)
? "pdf-viewer-update-enabled"
: "");
dict->SetKey("documentPropertiesEnabled", dict->SetKey("documentPropertiesEnabled",
base::Value(base::FeatureList::IsEnabled( base::Value(base::FeatureList::IsEnabled(
chrome_pdf::features::kPdfViewerDocumentProperties))); chrome_pdf::features::kPdfViewerDocumentProperties)));
......
<!doctype html> <!doctype html>
<html dir="$i18n{textdirection}" lang="$i18n{language}" <html dir="$i18n{textdirection}" lang="$i18n{language}"
$i18n{pdfViewerUpdateEnabledAttribute}> pdf-viewer-update-enabled>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
......
...@@ -847,17 +847,13 @@ void OutOfProcessInstance::DidChangeView(const pp::View& view) { ...@@ -847,17 +847,13 @@ void OutOfProcessInstance::DidChangeView(const pp::View& view) {
OnGeometryChanged(zoom(), old_device_scale); OnGeometryChanged(zoom(), old_device_scale);
} }
if (!is_print_preview_ && if (is_print_preview_ && !stop_scrolling_) {
base::FeatureList::IsEnabled(features::kPDFViewerUpdate)) {
// Scrolling in the new PDF Viewer UI is already handled by
// HandleUpdateScrollMessage().
return;
}
if (!stop_scrolling_) {
scroll_position_ = PointFromPPPoint(view.GetScrollOffset()); scroll_position_ = PointFromPPPoint(view.GetScrollOffset());
UpdateScroll(); UpdateScroll();
} }
// Scrolling in the main PDF Viewer UI is already handled by
// HandleUpdateScrollMessage().
} }
void OutOfProcessInstance::UpdateScroll() { void OutOfProcessInstance::UpdateScroll() {
...@@ -1936,8 +1932,7 @@ void OutOfProcessInstance::HandleSaveMessage(const pp::VarDictionary& dict) { ...@@ -1936,8 +1932,7 @@ void OutOfProcessInstance::HandleSaveMessage(const pp::VarDictionary& dict) {
void OutOfProcessInstance::HandleSetReadOnlyMessage( void OutOfProcessInstance::HandleSetReadOnlyMessage(
const pp::VarDictionary& dict) { const pp::VarDictionary& dict) {
if (!base::FeatureList::IsEnabled(features::kPDFViewerUpdate) || if (!base::FeatureList::IsEnabled(features::kPdfViewerPresentationMode) ||
!base::FeatureList::IsEnabled(features::kPdfViewerPresentationMode) ||
!dict.Get(pp::Var(kJSEnableReadOnly)).is_bool()) { !dict.Get(pp::Var(kJSEnableReadOnly)).is_bool()) {
NOTREACHED(); NOTREACHED();
return; return;
...@@ -1948,8 +1943,7 @@ void OutOfProcessInstance::HandleSetReadOnlyMessage( ...@@ -1948,8 +1943,7 @@ void OutOfProcessInstance::HandleSetReadOnlyMessage(
void OutOfProcessInstance::HandleSetTwoUpViewMessage( void OutOfProcessInstance::HandleSetTwoUpViewMessage(
const pp::VarDictionary& dict) { const pp::VarDictionary& dict) {
if (!base::FeatureList::IsEnabled(features::kPDFViewerUpdate) || if (!dict.Get(pp::Var(kJSEnableTwoUpView)).is_bool()) {
!dict.Get(pp::Var(kJSEnableTwoUpView)).is_bool()) {
NOTREACHED(); NOTREACHED();
return; return;
} }
...@@ -1959,8 +1953,7 @@ void OutOfProcessInstance::HandleSetTwoUpViewMessage( ...@@ -1959,8 +1953,7 @@ void OutOfProcessInstance::HandleSetTwoUpViewMessage(
void OutOfProcessInstance::HandleUpdateScrollMessage( void OutOfProcessInstance::HandleUpdateScrollMessage(
const pp::VarDictionary& dict) { const pp::VarDictionary& dict) {
if (!base::FeatureList::IsEnabled(features::kPDFViewerUpdate) || if (!dict.Get(pp::Var(kJSUpdateScrollX)).is_number() ||
!dict.Get(pp::Var(kJSUpdateScrollX)).is_number() ||
!dict.Get(pp::Var(kJSUpdateScrollY)).is_number()) { !dict.Get(pp::Var(kJSUpdateScrollY)).is_number()) {
NOTREACHED(); NOTREACHED();
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment