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

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: Initialise background color to 0. 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
« no previous file with comments | « chrome/browser/resources/pdf/index-material.css ('k') | pdf/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 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 * Each bookmark is an Object containing a: 697 * Each bookmark is an Object containing a:
695 * - title 698 * - title
696 * - page (optional) 699 * - page (optional)
697 * - array of children (themselves bookmarks) 700 * - array of children (themselves bookmarks)
698 * @type {Array} the top-level bookmarks of the PDF. 701 * @type {Array} the top-level bookmarks of the PDF.
699 */ 702 */
700 get bookmarks() { 703 get bookmarks() {
701 return this.bookmarks_; 704 return this.bookmarks_;
702 } 705 }
703 }; 706 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/index-material.css ('k') | pdf/instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698