Commit 0fba6792 authored by rbpotter's avatar rbpotter Committed by Commit Bot

PDFViewerUpdate: Annotation mode dialog fixes

- Remove ampersand symbol (&) from IDS_EDIT string before adding to the
  PDF viewer UI.
- Don't toggle annotation mode if dialog is not confirmed
- Strings - remove ending '.' per UX feedback

Bug: 1048876
Change-Id: Ie8afacd21b10595e6c1ef8878ca5091027042224
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429976
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810824}
parent 102aa7a5
......@@ -78,7 +78,6 @@ void AddPdfViewerStrings(base::Value* dict) {
{"annotationResetTwoPageView", IDS_PDF_ANNOTATION_RESET_TWO_PAGE_VIEW},
{"annotationResetRotateAndTwoPageView",
IDS_PDF_ANNOTATION_RESET_ROTATE_AND_TWO_PAGE_VIEW},
{"editButton", IDS_EDIT},
{"cancelButton", IDS_CANCEL},
{"annotationPen", IDS_PDF_ANNOTATION_PEN},
{"annotationHighlighter", IDS_PDF_ANNOTATION_HIGHLIGHTER},
......@@ -131,6 +130,12 @@ void AddPdfViewerStrings(base::Value* dict) {
for (const auto& resource : kPdfResources)
dict->SetStringKey(resource.name, l10n_util::GetStringUTF16(resource.id));
#if defined(OS_CHROMEOS)
base::string16 edit_string = l10n_util::GetStringUTF16(IDS_EDIT);
base::Erase(edit_string, '&');
dict->SetStringKey("editButton", edit_string);
#endif
webui::SetLoadTimeDataDefaults(g_browser_process->GetApplicationLocale(),
static_cast<base::DictionaryValue*>(dict));
}
......
......@@ -347,13 +347,15 @@ export class ViewerPdfToolbarNewElement extends PolymerElement {
// <if expr="chromeos">
/** @private */
onDialogClose_() {
if (/** @type {!ViewerAnnotationsModeDialogElement} */ (
const confirmed =
/** @type {!ViewerAnnotationsModeDialogElement} */ (
this.shadowRoot.querySelector('viewer-annotations-mode-dialog'))
.wasConfirmed()) {
.wasConfirmed();
this.showAnnotationsModeDialog_ = false;
if (confirmed) {
this.dispatchEvent(new CustomEvent('annotation-mode-dialog-confirmed'));
this.toggleAnnotation();
}
this.showAnnotationsModeDialog_ = false;
this.toggleAnnotation();
}
/** @private */
......
......@@ -109,13 +109,13 @@
Edit annotations in default view?
</message>
<message name="IDS_PDF_ANNOTATION_RESET_ROTATE" desc="Text in a dialog informing the user that rotation will be reset to default if they continue to annotation mode">
When you edit annotations, this document will return to its original rotation.
When you edit annotations, this document will return to its original rotation
</message>
<message name="IDS_PDF_ANNOTATION_RESET_TWO_PAGE_VIEW" desc="Text in a dialog informing the user that the view will reset to single page if they continue to annotation mode">
When you edit annotations, this document will return to single page view.
When you edit annotations, this document will return to single page view
</message>
<message name="IDS_PDF_ANNOTATION_RESET_ROTATE_AND_TWO_PAGE_VIEW" desc="Text in a dialog informing the user that rotation will be reset to default and the view will reset to single page if they continue to annotation mode">
When you edit annotations, this document will return to single page view and its original rotation.
When you edit annotations, this document will return to single page view and its original rotation
</message>
<message name="IDS_PDF_ANNOTATION_DOCUMENT_TOO_LARGE" desc="Button tooltip to indicate why 'Annotation mode' which allows writing, drawing and highlighting of the PDF document is not available due to the document being too large">
Document is too large to be annotated
......
9388f341e58e71464573cca01fada0b1ccba1184
\ No newline at end of file
525f786258dbf0e41fae6aef0794b34e51ad13f3
\ No newline at end of file
074e3b252b8c9255db1753d0d2df7d92c2b38b0b
\ No newline at end of file
ebe03b9a3d8f684f8def40211b78420e99e7e509
\ No newline at end of file
086e1d873ed0bbe924d9b7ebea2d6fc4832e78a4
\ No newline at end of file
4e2ec648594b741316ffc2d68ede144c2819a2ba
\ No newline at end of file
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