Commit 2d10ff58 authored by rbpotter's avatar rbpotter Committed by Commit Bot

PDF Viewer: Move controllers to a separate file

pdf_viewer.js is extremely long, and there is no reason the controllers
need to be in the same file with the PDF viewer class. This will also
simplify the process of closure compiling pdf_viewer.js, as handling
the dependencies between the viewer and the controllers and compiling
the controller portion of the code will be easier to separate from the
work to compile the rest of pdf_viewer.js.

Bug: 721073
Change-Id: Ife7a9fefd8a1a552fe5b15dbb747aaa0aa9b89b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1793814Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695014}
parent fe8612d0
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
<include name="IDR_PDF_INDEX_CSS" file="pdf/index.css" allowexternalscript="true" type="BINDATA" /> <include name="IDR_PDF_INDEX_CSS" file="pdf/index.css" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PDF_MAIN_JS" file="pdf/main.js" type="BINDATA" /> <include name="IDR_PDF_MAIN_JS" file="pdf/main.js" type="BINDATA" />
<include name="IDR_PDF_PDF_VIEWER_JS" file="pdf/pdf_viewer.js" type="BINDATA" /> <include name="IDR_PDF_PDF_VIEWER_JS" file="pdf/pdf_viewer.js" type="BINDATA" />
<include name="IDR_PDF_CONTROLLER_JS" file="pdf/controller.js" type="BINDATA" />
<include name="IDR_PDF_TOOLBAR_MANAGER_JS" file="pdf/toolbar_manager.js" type="BINDATA" /> <include name="IDR_PDF_TOOLBAR_MANAGER_JS" file="pdf/toolbar_manager.js" type="BINDATA" />
<include name="IDR_PDF_PDF_FITTING_TYPE_JS" file="pdf/pdf_fitting_type.js" type="BINDATA" /> <include name="IDR_PDF_PDF_FITTING_TYPE_JS" file="pdf/pdf_fitting_type.js" type="BINDATA" />
<include name="IDR_PDF_VIEWPORT_JS" file="pdf/viewport.js" type="BINDATA" /> <include name="IDR_PDF_VIEWPORT_JS" file="pdf/viewport.js" type="BINDATA" />
......
This diff is collapsed.
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<script src="chrome://resources/js/promise_resolver.js"></script> <script src="chrome://resources/js/promise_resolver.js"></script>
<script src="browser_api.js"></script> <script src="browser_api.js"></script>
<script src="metrics.js"></script> <script src="metrics.js"></script>
<script src="controller.js"></script>
<script src="pdf_viewer.js"></script> <script src="pdf_viewer.js"></script>
<script src="main.js"></script> <script src="main.js"></script>
</html> </html>
This diff is collapsed.
...@@ -343,6 +343,7 @@ void SetupPrintPreviewPlugin(content::WebUIDataSource* source) { ...@@ -343,6 +343,7 @@ void SetupPrintPreviewPlugin(content::WebUIDataSource* source) {
int id; int id;
} kPdfResources[] = { } kPdfResources[] = {
{"pdf/browser_api.js", IDR_PDF_BROWSER_API_JS}, {"pdf/browser_api.js", IDR_PDF_BROWSER_API_JS},
{"pdf/controller.js", IDR_PDF_CONTROLLER_JS},
{"pdf/elements/icons.html", IDR_PDF_ICONS_HTML}, {"pdf/elements/icons.html", IDR_PDF_ICONS_HTML},
{"pdf/elements/shared-vars.html", IDR_PDF_SHARED_VARS_HTML}, {"pdf/elements/shared-vars.html", IDR_PDF_SHARED_VARS_HTML},
{"pdf/elements/viewer-bookmark/viewer-bookmark.html", {"pdf/elements/viewer-bookmark/viewer-bookmark.html",
......
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