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

Side by Side Diff: chrome/browser/resources/pdf/pdf.js

Issue 1090313003: Correctly align and ellipsize PDF titles in material design PDF viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 this.plugin_.type = 'application/x-google-chrome-pdf'; 106 this.plugin_.type = 'application/x-google-chrome-pdf';
107 this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this), 107 this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this),
108 false); 108 false);
109 109
110 // Handle scripting messages from outside the extension that wish to interact 110 // Handle scripting messages from outside the extension that wish to interact
111 // with it. We also send a message indicating that extension has loaded and 111 // with it. We also send a message indicating that extension has loaded and
112 // is ready to receive messages. 112 // is ready to receive messages.
113 window.addEventListener('message', this.handleScriptingMessage.bind(this), 113 window.addEventListener('message', this.handleScriptingMessage.bind(this),
114 false); 114 false);
115 115
116 document.title = 116 document.title = decodeURIComponent(
117 getFilenameFromURL(this.browserApi_.getStreamInfo().originalUrl); 117 getFilenameFromURL(this.browserApi_.getStreamInfo().originalUrl));
118 this.plugin_.setAttribute('src', 118 this.plugin_.setAttribute('src',
119 this.browserApi_.getStreamInfo().originalUrl); 119 this.browserApi_.getStreamInfo().originalUrl);
120 this.plugin_.setAttribute('stream-url', 120 this.plugin_.setAttribute('stream-url',
121 this.browserApi_.getStreamInfo().streamUrl); 121 this.browserApi_.getStreamInfo().streamUrl);
122 var headers = ''; 122 var headers = '';
123 for (var header in this.browserApi_.getStreamInfo().responseHeaders) { 123 for (var header in this.browserApi_.getStreamInfo().responseHeaders) {
124 headers += header + ': ' + 124 headers += header + ': ' +
125 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n'; 125 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n';
126 } 126 }
127 this.plugin_.setAttribute('headers', headers); 127 this.plugin_.setAttribute('headers', headers);
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 * Each bookmark is an Object containing a: 751 * Each bookmark is an Object containing a:
752 * - title 752 * - title
753 * - page (optional) 753 * - page (optional)
754 * - array of children (themselves bookmarks) 754 * - array of children (themselves bookmarks)
755 * @type {Array} the top-level bookmarks of the PDF. 755 * @type {Array} the top-level bookmarks of the PDF.
756 */ 756 */
757 get bookmarks() { 757 get bookmarks() {
758 return this.bookmarks_; 758 return this.bookmarks_;
759 } 759 }
760 }; 760 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698