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

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

Issue 2299943002: Record the PDF and top level URL when the PDF plugin crashes. (Closed)
Patch Set: fix typo Created 4 years, 3 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/browser_api.js ('k') | pdf/out_of_process_instance.cc » ('j') | 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 for (var header in this.browserApi_.getStreamInfo().responseHeaders) { 165 for (var header in this.browserApi_.getStreamInfo().responseHeaders) {
166 headers += header + ': ' + 166 headers += header + ': ' +
167 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n'; 167 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n';
168 } 168 }
169 this.plugin_.setAttribute('headers', headers); 169 this.plugin_.setAttribute('headers', headers);
170 170
171 var backgroundColor = PDFViewer.DARK_BACKGROUND_COLOR; 171 var backgroundColor = PDFViewer.DARK_BACKGROUND_COLOR;
172 this.plugin_.setAttribute('background-color', backgroundColor); 172 this.plugin_.setAttribute('background-color', backgroundColor);
173 this.plugin_.setAttribute('top-toolbar-height', topToolbarHeight); 173 this.plugin_.setAttribute('top-toolbar-height', topToolbarHeight);
174 174
175 if (!this.browserApi_.getStreamInfo().embedded) 175 if (this.browserApi_.getStreamInfo().embedded) {
176 this.plugin_.setAttribute('top-level-url',
177 this.browserApi_.getStreamInfo().tabUrl);
178 } else {
176 this.plugin_.setAttribute('full-frame', ''); 179 this.plugin_.setAttribute('full-frame', '');
180 }
177 document.body.appendChild(this.plugin_); 181 document.body.appendChild(this.plugin_);
178 182
179 // Setup the button event listeners. 183 // Setup the button event listeners.
180 this.zoomToolbar_ = $('zoom-toolbar'); 184 this.zoomToolbar_ = $('zoom-toolbar');
181 this.zoomToolbar_.addEventListener('fit-to-width', 185 this.zoomToolbar_.addEventListener('fit-to-width',
182 this.viewport_.fitToWidth.bind(this.viewport_)); 186 this.viewport_.fitToWidth.bind(this.viewport_));
183 this.zoomToolbar_.addEventListener('fit-to-page', 187 this.zoomToolbar_.addEventListener('fit-to-page',
184 this.fitToPage_.bind(this)); 188 this.fitToPage_.bind(this));
185 this.zoomToolbar_.addEventListener('zoom-in', 189 this.zoomToolbar_.addEventListener('zoom-in',
186 this.viewport_.zoomIn.bind(this.viewport_)); 190 this.viewport_.zoomIn.bind(this.viewport_));
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 * Each bookmark is an Object containing a: 859 * Each bookmark is an Object containing a:
856 * - title 860 * - title
857 * - page (optional) 861 * - page (optional)
858 * - array of children (themselves bookmarks) 862 * - array of children (themselves bookmarks)
859 * @type {Array} the top-level bookmarks of the PDF. 863 * @type {Array} the top-level bookmarks of the PDF.
860 */ 864 */
861 get bookmarks() { 865 get bookmarks() {
862 return this.bookmarks_; 866 return this.bookmarks_;
863 } 867 }
864 }; 868 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/browser_api.js ('k') | pdf/out_of_process_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698