OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * @return {number} Width of a scrollbar in pixels | 8 * @return {number} Width of a scrollbar in pixels |
9 */ | 9 */ |
10 function getScrollbarWidth() { | 10 function getScrollbarWidth() { |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 this.toolbar_.docLength = | 597 this.toolbar_.docLength = |
598 this.documentDimensions_.pageDimensions.length; | 598 this.documentDimensions_.pageDimensions.length; |
599 } | 599 } |
600 break; | 600 break; |
601 case 'email': | 601 case 'email': |
602 var href = 'mailto:' + message.data.to + '?cc=' + message.data.cc + | 602 var href = 'mailto:' + message.data.to + '?cc=' + message.data.cc + |
603 '&bcc=' + message.data.bcc + '&subject=' + message.data.subject + | 603 '&bcc=' + message.data.bcc + '&subject=' + message.data.subject + |
604 '&body=' + message.data.body; | 604 '&body=' + message.data.body; |
605 window.location.href = href; | 605 window.location.href = href; |
606 break; | 606 break; |
607 case 'getAccessibilityJSONReply': | |
608 this.sendScriptingMessage_(message.data); | |
609 break; | |
610 case 'getPassword': | 607 case 'getPassword': |
611 // If the password screen isn't up, put it up. Otherwise we're | 608 // If the password screen isn't up, put it up. Otherwise we're |
612 // responding to an incorrect password so deny it. | 609 // responding to an incorrect password so deny it. |
613 if (!this.passwordScreen_.active) | 610 if (!this.passwordScreen_.active) |
614 this.passwordScreen_.active = true; | 611 this.passwordScreen_.active = true; |
615 else | 612 else |
616 this.passwordScreen_.deny(); | 613 this.passwordScreen_.deny(); |
617 break; | 614 break; |
618 case 'getSelectedTextReply': | 615 case 'getSelectedTextReply': |
619 this.sendScriptingMessage_(message.data); | 616 this.sendScriptingMessage_(message.data); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 return; | 772 return; |
776 | 773 |
777 // Delay scripting messages from users of the scripting API until the | 774 // Delay scripting messages from users of the scripting API until the |
778 // document is loaded. This simplifies use of the APIs. | 775 // document is loaded. This simplifies use of the APIs. |
779 if (this.loadState_ != LoadState.SUCCESS) { | 776 if (this.loadState_ != LoadState.SUCCESS) { |
780 this.delayedScriptingMessages_.push(message); | 777 this.delayedScriptingMessages_.push(message); |
781 return; | 778 return; |
782 } | 779 } |
783 | 780 |
784 switch (message.data.type.toString()) { | 781 switch (message.data.type.toString()) { |
785 case 'getAccessibilityJSON': | |
786 case 'getSelectedText': | 782 case 'getSelectedText': |
787 case 'print': | 783 case 'print': |
788 case 'selectAll': | 784 case 'selectAll': |
789 this.plugin_.postMessage(message.data); | 785 this.plugin_.postMessage(message.data); |
790 break; | 786 break; |
791 } | 787 } |
792 }, | 788 }, |
793 | 789 |
794 /** | 790 /** |
795 * @private | 791 * @private |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 * Each bookmark is an Object containing a: | 874 * Each bookmark is an Object containing a: |
879 * - title | 875 * - title |
880 * - page (optional) | 876 * - page (optional) |
881 * - array of children (themselves bookmarks) | 877 * - array of children (themselves bookmarks) |
882 * @type {Array} the top-level bookmarks of the PDF. | 878 * @type {Array} the top-level bookmarks of the PDF. |
883 */ | 879 */ |
884 get bookmarks() { | 880 get bookmarks() { |
885 return this.bookmarks_; | 881 return this.bookmarks_; |
886 } | 882 } |
887 }; | 883 }; |
OLD | NEW |