Commit fc3d2711 authored by Daniel Hosseinian's avatar Daniel Hosseinian Committed by Chromium LUCI CQ

PDF Viewer: Show PDF linearization among properties

Bug: 93619
Change-Id: Iabd045503b598b0469fedc37e99afd5fdb9620da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622001
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842551}
parent 1c0be583
...@@ -71,6 +71,8 @@ void AddPdfViewerStrings(base::Value* dict) { ...@@ -71,6 +71,8 @@ void AddPdfViewerStrings(base::Value* dict) {
{"propertiesDialogClose", IDS_CLOSE}, {"propertiesDialogClose", IDS_CLOSE},
{"propertiesDialogTitle", IDS_PDF_PROPERTIES_DIALOG_TITLE}, {"propertiesDialogTitle", IDS_PDF_PROPERTIES_DIALOG_TITLE},
{"propertiesFastWebView", IDS_PDF_PROPERTIES_FAST_WEB_VIEW}, {"propertiesFastWebView", IDS_PDF_PROPERTIES_FAST_WEB_VIEW},
{"propertiesFastWebViewNo", IDS_PDF_PROPERTIES_FAST_WEB_VIEW_NO},
{"propertiesFastWebViewYes", IDS_PDF_PROPERTIES_FAST_WEB_VIEW_YES},
{"propertiesFileName", IDS_PDF_PROPERTIES_FILE_NAME}, {"propertiesFileName", IDS_PDF_PROPERTIES_FILE_NAME},
{"propertiesFileSize", IDS_PDF_PROPERTIES_FILE_SIZE}, {"propertiesFileSize", IDS_PDF_PROPERTIES_FILE_SIZE},
{"propertiesKeywords", IDS_PDF_PROPERTIES_KEYWORDS}, {"propertiesKeywords", IDS_PDF_PROPERTIES_KEYWORDS},
......
...@@ -22,6 +22,7 @@ export const DisplayAnnotationsAction = { ...@@ -22,6 +22,7 @@ export const DisplayAnnotationsAction = {
* author: string, * author: string,
* canSerializeDocument: boolean, * canSerializeDocument: boolean,
* creator: string, * creator: string,
* linearized: boolean,
* producer: string, * producer: string,
* subject: string, * subject: string,
* title: string, * title: string,
......
...@@ -102,7 +102,11 @@ ...@@ -102,7 +102,11 @@
</tr> </tr>
<tr> <tr>
<td class="name">$i18n{propertiesFastWebView}</td> <td class="name">$i18n{propertiesFastWebView}</td>
<td class="value" id="fast-web-view">-</td> <td class="value" id="fast-web-view">
[[getFastWebViewValue_('$i18nPolymer{propertiesFastWebViewYes}',
'$i18nPolymer{propertiesFastWebViewNo}',
documentMetadata.linearized)]]
</td>
</tr> </tr>
</table> </table>
</div> </div>
......
...@@ -35,6 +35,17 @@ export class ViewerPropertiesDialogElement extends PolymerElement { ...@@ -35,6 +35,17 @@ export class ViewerPropertiesDialogElement extends PolymerElement {
this.shadowRoot.querySelector('cr-dialog')); this.shadowRoot.querySelector('cr-dialog'));
} }
/**
* @param {string} yesLabel
* @param {string} noLabel
* @param {boolean} linearized
* @return {string}
* @private
*/
getFastWebViewValue_(yesLabel, noLabel, linearized) {
return linearized ? yesLabel : noLabel;
}
/** /**
* @param {string} value * @param {string} value
* @return {string} * @return {string}
......
...@@ -63,7 +63,7 @@ const tests = [ ...@@ -63,7 +63,7 @@ const tests = [
['pdf-version', '1.7'], ['pdf-version', '1.7'],
['page-count', '-'], ['page-count', '-'],
['page-size', '-'], ['page-size', '-'],
['fast-web-view', '-'], ['fast-web-view', 'No'],
].forEach(([field, expectedValue]) => assertField(field, expectedValue)); ].forEach(([field, expectedValue]) => assertField(field, expectedValue));
await ensurePropertiesDialogClose(); await ensurePropertiesDialogClose();
......
...@@ -88,6 +88,12 @@ ...@@ -88,6 +88,12 @@
<message name="IDS_PDF_PROPERTIES_FAST_WEB_VIEW" desc="Name of the property describing whether the PDF document is organized to be viewed efficiently in network environments."> <message name="IDS_PDF_PROPERTIES_FAST_WEB_VIEW" desc="Name of the property describing whether the PDF document is organized to be viewed efficiently in network environments.">
Fast web view: Fast web view:
</message> </message>
<message name="IDS_PDF_PROPERTIES_FAST_WEB_VIEW_NO" desc="Label indicating that the PDF document is not organized to be viewed efficiently in network environments.">
No
</message>
<message name="IDS_PDF_PROPERTIES_FAST_WEB_VIEW_YES" desc="Label indicating that the PDF document is organized to be viewed efficiently in network environments.">
Yes
</message>
<message name="IDS_PDF_TOOLTIP_ROTATE_CW" desc="Button tooltip for the button which rotates a PDF document clockwise"> <message name="IDS_PDF_TOOLTIP_ROTATE_CW" desc="Button tooltip for the button which rotates a PDF document clockwise">
Rotate clockwise Rotate clockwise
......
655257b2deb63eba2b20cb7844f9e3d97e6337c1
\ No newline at end of file
0dcdcf57e7aa53d2f27dfc832a51234aa26b6631
\ No newline at end of file
...@@ -132,6 +132,7 @@ constexpr char kJSBookmarksData[] = "bookmarksData"; ...@@ -132,6 +132,7 @@ constexpr char kJSBookmarksData[] = "bookmarksData";
constexpr char kJSMetadataType[] = "metadata"; constexpr char kJSMetadataType[] = "metadata";
constexpr char kJSMetadataData[] = "metadataData"; constexpr char kJSMetadataData[] = "metadataData";
constexpr char kJSVersion[] = "version"; constexpr char kJSVersion[] = "version";
constexpr char kJSLinearized[] = "linearized";
constexpr char kJSTitle[] = "title"; constexpr char kJSTitle[] = "title";
constexpr char kJSAuthor[] = "author"; constexpr char kJSAuthor[] = "author";
constexpr char kJSSubject[] = "subject"; constexpr char kJSSubject[] = "subject";
...@@ -2429,6 +2430,9 @@ void OutOfProcessInstance::SendMetadata() { ...@@ -2429,6 +2430,9 @@ void OutOfProcessInstance::SendMetadata() {
if (!version.empty()) if (!version.empty())
metadata_data.Set(pp::Var(kJSVersion), pp::Var(base::UTF16ToUTF8(version))); metadata_data.Set(pp::Var(kJSVersion), pp::Var(base::UTF16ToUTF8(version)));
metadata_data.Set(pp::Var(kJSLinearized),
pp::Var(document_metadata.linearized));
if (!document_metadata.title.empty()) if (!document_metadata.title.empty())
metadata_data.Set(pp::Var(kJSTitle), pp::Var(document_metadata.title)); metadata_data.Set(pp::Var(kJSTitle), pp::Var(document_metadata.title));
......
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