forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Header and Footer support in Linux, Windows and Mac for Skia
BUG=67514 TEST= In the preview tab, note added options for printing headers and footers. Toggle with the checkbox and ensure that the correct headers and footers are displayed. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97219 Review URL: http://codereview.chromium.org/7348010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97233 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
aayushkumar@chromium.org
committed
Aug 17, 2011
1 parent
4e8e0d1
commit 55b23a0
Showing
36 changed files
with
738 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
chrome/browser/resources/print_preview/header_footer_settings.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div id="header-footer-option" class="two-column option visible"> | ||
<h1 i18n-content="optionsLabel"></h1> | ||
<div> | ||
<input id="header-footer" type="checkbox" checked> | ||
<label for="header-footer" i18n-content="optionHeaderFooter"></label> | ||
</div> | ||
</div> |
68 changes: 68 additions & 0 deletions
68
chrome/browser/resources/print_preview/header_footer_settings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright (c) 2011 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
cr.define('print_preview', function() { | ||
'use strict'; | ||
|
||
/** | ||
* Creates a HeaderFooterSettings object. This object encapsulates all | ||
* settings and logic related to the headers and footers checkbox. | ||
* @constructor | ||
*/ | ||
function HeaderFooterSettings() { | ||
this.headerFooterOption_ = $('header-footer-option'); | ||
this.headerFooterCheckbox_ = $('header-footer'); | ||
} | ||
|
||
cr.addSingletonGetter(HeaderFooterSettings); | ||
|
||
HeaderFooterSettings.prototype = { | ||
/** | ||
* The checkbox corresponding to the headers and footers option. | ||
* @type {HTMLInputElement} | ||
*/ | ||
get headerFooterCheckbox() { | ||
return this.headerFooterCheckbox_; | ||
}, | ||
|
||
/** | ||
* Checks whether the Headers and Footers checkbox is checked or not. | ||
* @return {boolean} true if Headers and Footers are checked. | ||
*/ | ||
hasHeaderFooter: function() { | ||
return this.headerFooterCheckbox_.checked; | ||
}, | ||
|
||
/** | ||
* Adding listeners to header footer related controls. | ||
*/ | ||
addEventListeners: function() { | ||
this.headerFooterCheckbox_.onclick = | ||
this.onHeaderFooterChanged_.bind(this); | ||
document.addEventListener('PDFLoaded', this.onPDFLoaded_.bind(this)); | ||
}, | ||
|
||
/** | ||
* Listener executing when the user selects or de-selects the headers | ||
* and footers option. | ||
* @private | ||
*/ | ||
onHeaderFooterChanged_: function() { | ||
requestPrintPreview(); | ||
}, | ||
|
||
/** | ||
* Listener executing when a PDFLoaded event occurs. | ||
* @private | ||
*/ | ||
onPDFLoaded_: function() { | ||
if (!previewModifiable) | ||
fadeOutElement(this.headerFooterOption_); | ||
}, | ||
}; | ||
|
||
return { | ||
HeaderFooterSettings: HeaderFooterSettings, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.