Commit 0220c3bc authored by rbpotter's avatar rbpotter Committed by Commit Bot

PDF Viewer: Closure compile pdf_viewer.js

This is the last remaining file in the PDF viewer that is not closure
compiled.

Bug: 721073
Change-Id: I9093804ffcd961a8c8a2d6e80b6888996f08f4e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808072
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697643}
parent 7368cffe
......@@ -88,19 +88,38 @@ js_library("navigator") {
js_library("toolbar_manager") {
deps = [
"elements/viewer-pdf-toolbar:viewer-pdf-toolbar",
"elements/viewer-zoom-toolbar:viewer-zoom-toolbar",
"elements/viewer-pdf-toolbar",
"elements/viewer-zoom-toolbar",
]
}
js_library("controller") {
deps = [
":viewport",
"elements/viewer-pdf-toolbar",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js/cr:event_target",
]
}
js_library("pdf_viewer") {
deps = [
":controller",
":navigator",
":toolbar_manager",
":viewport",
"elements/viewer-bookmark",
"elements/viewer-error-screen",
"elements/viewer-page-indicator",
"elements/viewer-password-screen",
"elements/viewer-pdf-toolbar",
"elements/viewer-zoom-toolbar",
"//ui/webui/resources/js:event_tracker",
"//ui/webui/resources/js:load_time_data",
]
externs_list = [ "$externs_path/resources_private.js" ]
}
js_type_check("pdf_resources") {
deps = [
":browser_api",
......@@ -111,6 +130,7 @@ js_type_check("pdf_resources") {
":open_pdf_params_parser",
":pdf_fitting_type",
":pdf_scripting_api",
":pdf_viewer",
":toolbar_manager",
":viewport",
":viewport_scroller",
......
......@@ -39,21 +39,12 @@ let EmailMessageData;
*/
let PrintPreviewParams;
// Note: Redefining these types here, to work around the fact that ink externs
// Note: Redefining this type here, to work around the fact that ink externs
// are only available on Chrome OS, so the targets that contain them cannot be
// built on other platforms.
// TODO (rbpotter): Break InkController into its own file that is only included
// on Chrome OS.
/**
* @typedef {{
* tool: string,
* size: number,
* color: string,
* }}
*/
let AnnotationTool;
/**
* @typedef {{
* setAnnotationTool: function(AnnotationTool):void,
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Note: Redefining this type here, to work around the fact that ink externs
// are only available on Chrome OS, so the targets that contain them cannot be
// built on other platforms.
/**
* @typedef {{
* tool: string,
* size: number,
* color: (string|null),
* }}
*/
let AnnotationTool;
(function() {
Polymer({
is: 'viewer-pdf-toolbar',
......@@ -24,7 +38,7 @@ Polymer({
reflectToAttribute: true,
},
/** @type {?Object} */
/** @type {?AnnotationTool} */
annotationTool: {
type: Object,
value: null,
......
......@@ -2,6 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @typedef {{
* fittingType: !FittingType,
* userInitiated: boolean,
* }}
*/
let FitToChangedEvent;
(function() {
const FIT_TO_PAGE_BUTTON_STATE = 0;
......
......@@ -6,7 +6,7 @@
* Turn a dictionary received from postMessage into a key event.
*
* @param {Object} dict A dictionary representing the key event.
* @return {Event} A key event.
* @return {!Event} A key event.
*/
function DeserializeKeyEvent(dict) {
const e = document.createEvent('Event');
......
This diff is collapsed.
......@@ -49,14 +49,14 @@ function isMouseNearSideToolbar(e, window, reverse) {
class ToolbarManager {
/**
* @param {!Window} window The window containing the UI.
* @param {!ViewerPdfToolbarElement} toolbar
* @param {?ViewerPdfToolbarElement} toolbar
* @param {!ViewerZoomToolbarElement} zoomToolbar
*/
constructor(window, toolbar, zoomToolbar) {
/** @private {!Window} */
this.window_ = window;
/** @private {!ViewerPdfToolbarElement} */
/** @private {?ViewerPdfToolbarElement} */
this.toolbar_ = toolbar;
/** @private {!ViewerZoomToolbarElement} */
......@@ -98,7 +98,7 @@ class ToolbarManager {
/** @param {!MouseEvent} e */
handleMouseMove(e) {
this.isMouseNearTopToolbar_ = this.toolbar_ && isMouseNearTopToolbar(e);
this.isMouseNearTopToolbar_ = !!this.toolbar_ && isMouseNearTopToolbar(e);
this.isMouseNearSideToolbar_ =
isMouseNearSideToolbar(e, this.window_, this.reverseSideToolbar_);
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @const
*/
chrome.resourcesPrivate = {};
/**
* Records a value than can range from 1 to 1,000,000.
* @param {string} component
* @param {!function(Object)} callback Callback to handle the dictionary of
* localized strings for |component|.
*/
chrome.resourcesPrivate.getStrings = function(component, callback) {};
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