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

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

Issue 871403005: Switch the background color in PDF Viewer when using Material Design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change background-color in index-material.css Created 5 years, 10 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
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // NOTE: The plugin's 'id' field must be set to 'plugin' since 83 // NOTE: The plugin's 'id' field must be set to 'plugin' since
84 // chrome/renderer/printing/print_web_view_helper.cc actually references it. 84 // chrome/renderer/printing/print_web_view_helper.cc actually references it.
85 this.plugin_.id = 'plugin'; 85 this.plugin_.id = 'plugin';
86 this.plugin_.type = 'application/x-google-chrome-pdf'; 86 this.plugin_.type = 'application/x-google-chrome-pdf';
87 this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this), 87 this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this),
88 false); 88 false);
89 this.plugin_.style.height = 89 this.plugin_.style.height =
90 (window.innerHeight - this.toolbarHeight_) + 'px'; 90 (window.innerHeight - this.toolbarHeight_) + 'px';
91 this.plugin_.style.width = window.innerWidth + 'px'; 91 this.plugin_.style.width = window.innerWidth + 'px';
92 92
93 if (this.isMaterial_)
94 this.plugin_.setAttribute('is-material', '');
95
93 // Handle scripting messages from outside the extension that wish to interact 96 // Handle scripting messages from outside the extension that wish to interact
94 // with it. We also send a message indicating that extension has loaded and 97 // with it. We also send a message indicating that extension has loaded and
95 // is ready to receive messages. 98 // is ready to receive messages.
96 window.addEventListener('message', this.handleScriptingMessage.bind(this), 99 window.addEventListener('message', this.handleScriptingMessage.bind(this),
97 false); 100 false);
98 101
99 document.title = getFilenameFromURL(this.streamDetails_.originalUrl); 102 document.title = getFilenameFromURL(this.streamDetails_.originalUrl);
100 if (this.isMaterial_) 103 if (this.isMaterial_)
101 $('title').textContent = document.title; 104 $('title').textContent = document.title;
102 this.plugin_.setAttribute('src', this.streamDetails_.originalUrl); 105 this.plugin_.setAttribute('src', this.streamDetails_.originalUrl);
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 * Each bookmark is an Object containing a: 683 * Each bookmark is an Object containing a:
681 * - title 684 * - title
682 * - page (optional) 685 * - page (optional)
683 * - array of children (themselves bookmarks) 686 * - array of children (themselves bookmarks)
684 * @type {Array} the top-level bookmarks of the PDF. 687 * @type {Array} the top-level bookmarks of the PDF.
685 */ 688 */
686 get bookmarks() { 689 get bookmarks() {
687 return this.bookmarks_; 690 return this.bookmarks_;
688 } 691 }
689 }; 692 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698