Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6693)

Unified Diff: chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js

Issue 898673003: Refactor Material Design PDF Viewer toolbar into a single element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve variable naming and documentation Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js
diff --git a/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js b/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b8c4d4035ccc9ef9237737070b80b44858570fe
--- /dev/null
+++ b/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js
@@ -0,0 +1,44 @@
+// 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.
+
+Polymer('viewer-pdf-toolbar', {
+
raymes 2015/02/04 00:54:25 nit remove the blank line
Alexandre Carlton 2015/02/04 04:28:46 Done.
+ /**
+ * @type {string}
+ * The filename of the PDF document.
+ */
+ filename: '',
raymes 2015/02/04 00:54:25 nit: we can add blank lines after each of the vari
Alexandre Carlton 2015/02/04 04:28:46 Done.
+ /**
+ * @type {number}
+ * The current index of the page being viewed (0-based).
+ */
+ pageIndex: 0,
+ /**
+ * @type {number}
+ * The current loading progress of the PDF document (0 - 100).
+ */
+ loadProgress: 0,
+ /**
+ * @type {number}
+ * The number of pages in the PDF document.
+ */
+ docLength: 1,
+
+ loadProgressChanged: function() {
+ if (this.loadProgress >= 100)
+ this.$.pageselector.style.visibility = 'visible';
+ },
+
+ toggleBookmarks: function() {
+ this.fire('toggle-bookmarks');
+ },
+
+ save: function() {
+ this.fire('save');
+ },
+
+ print: function() {
+ this.fire('print');
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698