Commit 520a12ce authored by tsepez@chromium.org's avatar tsepez@chromium.org

Add content-security-policy directive to print-preview pages.

Since print-preview uses an object tag, relax the object-src restriction in
the content_security_policy.html file.  Also fix typo in print_preview.html
where the object tag has a src="", not a data="" attribute.
Review URL: http://codereview.chromium.org/7566049

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95850 0039d316-1c4b-4281-b951-d872f2087c98
parent 05464a71
...@@ -84,7 +84,8 @@ ...@@ -84,7 +84,8 @@
<include name="IDR_PLUGINS_HTML" file="resources\plugins.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_PLUGINS_HTML" file="resources\plugins.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PLUGINS_JS" file="resources\plugins.js" type="BINDATA" /> <include name="IDR_PLUGINS_JS" file="resources\plugins.js" type="BINDATA" />
<include name="IDR_READER_OUT_OF_DATE_HTML" file="resources\reader_out_of_date.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_READER_OUT_OF_DATE_HTML" file="resources\reader_out_of_date.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_HTML" file="resources\print_preview\print_preview.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_PRINT_PREVIEW_HTML" file="resources\print_preview\print_preview.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_JS" file="resources\print_preview\print_preview.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_SAFE_BROWSING_MALWARE_BLOCK" file="resources\safe_browsing_malware_block.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SAFE_BROWSING_MALWARE_BLOCK" file="resources\safe_browsing_malware_block.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK" file="resources\safe_browsing_multiple_threat_block.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK" file="resources\safe_browsing_multiple_threat_block.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SAFE_BROWSING_PHISHING_BLOCK" file="resources\safe_browsing_phishing_block.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SAFE_BROWSING_PHISHING_BLOCK" file="resources\safe_browsing_phishing_block.html" flattenhtml="true" type="BINDATA" />
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
--> -->
<meta <meta
http-equiv="X-WebKit-CSP" http-equiv="X-WebKit-CSP"
content="object-src 'none'; content="object-src 'self';
script-src chrome://resources script-src chrome://resources
chrome-extension://mndnfokpggljbaajbnioimlmbfngpief chrome-extension://mndnfokpggljbaajbnioimlmbfngpief
'self' 'self'
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<html i18n-values="dir:textdirection;"> <html i18n-values="dir:textdirection;">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<include src="../content_security_policy.html"/>
<title i18n-content="title"></title> <title i18n-content="title"></title>
<link rel="icon" href="../../../app/theme/print_preview_favicon.png"> <link rel="icon" href="../../../app/theme/print_preview_favicon.png">
<link rel="stylesheet" href="../webui.css"> <link rel="stylesheet" href="../webui.css">
...@@ -10,15 +11,8 @@ ...@@ -10,15 +11,8 @@
<script src="chrome://resources/js/local_strings.js"></script> <script src="chrome://resources/js/local_strings.js"></script>
<script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/util.js"></script> <script src="chrome://resources/js/util.js"></script>
<script src="print_preview.js"></script> <script src="chrome://print/print_preview.js"></script>
<script src="print_preview_animations.js"></script> <script src="chrome://print/strings.js"></script>
<script src="print_preview_cloud.js"></script>
<script src="print_preview_utils.js"></script>
<script src="print_header.js"></script>
<script src="page_settings.js"></script>
<script src="copies_settings.js"></script>
<script src="layout_settings.js"></script>
<script src="color_settings.js"></script>
</head> </head>
<body> <body>
<div id="sidebar"> <div id="sidebar">
...@@ -70,6 +64,8 @@ ...@@ -70,6 +64,8 @@
</div> </div>
<object id="dummy-viewer" <object id="dummy-viewer"
type="application/x-google-chrome-print-preview-pdf" type="application/x-google-chrome-print-preview-pdf"
src="chrome://print/dummy.pdf"></object> data="chrome://print/dummy.pdf"></object>
<script src="chrome://resources/js/i18n_template.js"></script>
<script src="chrome://resources/js/i18n_process.js"></script>
</body> </body>
</html> </html>
...@@ -966,3 +966,12 @@ PrintSettings.prototype.save = function() { ...@@ -966,3 +966,12 @@ PrintSettings.prototype.save = function() {
this.isLandscape = layoutSettings.isLandscape(); this.isLandscape = layoutSettings.isLandscape();
} }
/// Pull in all other scripts in a single shot.
<include src="print_preview_animations.js"/>
<include src="print_preview_cloud.js"/>
<include src="print_preview_utils.js"/>
<include src="print_header.js"/>
<include src="page_settings.js"/>
<include src="copies_settings.js"/>
<include src="layout_settings.js"/>
<include src="color_settings.js"/>
...@@ -33,6 +33,9 @@ std::string ChromeWebUIDataSource::GetMimeType(const std::string& path) const { ...@@ -33,6 +33,9 @@ std::string ChromeWebUIDataSource::GetMimeType(const std::string& path) const {
if (EndsWith(path, ".js", false)) if (EndsWith(path, ".js", false))
return "application/javascript"; return "application/javascript";
if (EndsWith(path, ".pdf", false))
return "application/pdf";
return "text/html"; return "text/html";
} }
......
...@@ -23,117 +23,80 @@ ...@@ -23,117 +23,80 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
namespace { PrintPreviewDataSource::PrintPreviewDataSource()
: ChromeWebUIDataSource(chrome::kChromeUIPrintHost) {
void SetLocalizedStrings(DictionaryValue* localized_strings) { AddLocalizedString("title", IDS_PRINT_PREVIEW_TITLE);
localized_strings->SetString(std::string("title"), AddLocalizedString("loading", IDS_PRINT_PREVIEW_LOADING);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_TITLE));
localized_strings->SetString(std::string("loading"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_LOADING));
#if defined(GOOGLE_CHROME_BUILD) #if defined(GOOGLE_CHROME_BUILD)
localized_strings->SetString(std::string("noPlugin"), AddString("noPlugin", l10n_util::GetStringFUTF8(
l10n_util::GetStringFUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN, IDS_PRINT_PREVIEW_NO_PLUGIN, ASCIIToUTF16("chrome://plugins/"));
ASCIIToUTF16("chrome://plugins/")));
#else #else
localized_strings->SetString(std::string("noPlugin"), AddLocalizedString("noPlugin", IDS_PRINT_PREVIEW_NO_PLUGIN);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NO_PLUGIN));
#endif #endif
localized_strings->SetString(std::string("launchNativeDialog"), AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_NATIVE_DIALOG)); AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED);
localized_strings->SetString(std::string("previewFailed"), AddLocalizedString("initiatorTabClosed",
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_FAILED)); IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED);
localized_strings->SetString(std::string("initiatorTabClosed"), AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED));
localized_strings->SetString(std::string("reopenPage"), AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_REOPEN_PAGE)); AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON);
AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING);
localized_strings->SetString(std::string("printButton"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_BUTTON)); AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL);
localized_strings->SetString(std::string("cancelButton"), AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_CANCEL_BUTTON)); AddLocalizedString("examplePageRangeText",
localized_strings->SetString(std::string("printing"), IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINTING)); AddLocalizedString("invalidNumberOfCopies",
IDS_PRINT_PREVIEW_INVALID_NUMBER_OF_COPIES);
localized_strings->SetString(std::string("destinationLabel"), AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_DESTINATION_LABEL)); AddLocalizedString("optionAllPages", IDS_PRINT_PREVIEW_OPTION_ALL_PAGES);
localized_strings->SetString(std::string("copiesLabel"), AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_COPIES_LABEL)); AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE);
localized_strings->SetString(std::string("examplePageRangeText"), AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT)); AddLocalizedString("optionLandscape", IDS_PRINT_PREVIEW_OPTION_LANDSCAPE);
localized_strings->SetString(std::string("invalidNumberOfCopies"), AddLocalizedString("optionPortrait", IDS_PRINT_PREVIEW_OPTION_PORTRAIT);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INVALID_NUMBER_OF_COPIES)); AddLocalizedString("optionTwoSided", IDS_PRINT_PREVIEW_OPTION_TWO_SIDED);
localized_strings->SetString(std::string("layoutLabel"), AddLocalizedString("pagesLabel", IDS_PRINT_PREVIEW_PAGES_LABEL);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_LAYOUT_LABEL)); AddLocalizedString("pageRangeTextBox", IDS_PRINT_PREVIEW_PAGE_RANGE_TEXT);
localized_strings->SetString(std::string("optionAllPages"), AddLocalizedString("pageRangeRadio", IDS_PRINT_PREVIEW_PAGE_RANGE_RADIO);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_ALL_PAGES)); AddLocalizedString("printToPDF", IDS_PRINT_PREVIEW_PRINT_TO_PDF);
localized_strings->SetString(std::string("optionBw"), AddLocalizedString("printPreviewTitleFormat", IDS_PRINT_PREVIEW_TITLE_FORMAT);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_BW)); AddLocalizedString("printPreviewSummaryFormatShort",
localized_strings->SetString(std::string("optionCollate"), IDS_PRINT_PREVIEW_SUMMARY_FORMAT_SHORT);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_COLLATE)); AddLocalizedString("printPreviewSummaryFormatLong",
localized_strings->SetString(std::string("optionColor"), IDS_PRINT_PREVIEW_SUMMARY_FORMAT_LONG);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_COLOR)); AddLocalizedString("printPreviewSheetsLabelSingular",
localized_strings->SetString(std::string("optionLandscape"), IDS_PRINT_PREVIEW_SHEETS_LABEL_SINGULAR);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_LANDSCAPE)); AddLocalizedString("printPreviewSheetsLabelPlural",
localized_strings->SetString(std::string("optionPortrait"), IDS_PRINT_PREVIEW_SHEETS_LABEL_PLURAL);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_PORTRAIT)); AddLocalizedString("printPreviewPageLabelSingular",
localized_strings->SetString(std::string("optionTwoSided"), IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_TWO_SIDED)); AddLocalizedString("printPreviewPageLabelPlural",
localized_strings->SetString(std::string("pagesLabel"), IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGES_LABEL)); AddLocalizedString("systemDialogOption",
localized_strings->SetString(std::string("pageRangeTextBox"), IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_RANGE_TEXT)); AddLocalizedString("pageRangeInstruction",
localized_strings->SetString(std::string("pageRangeRadio"), IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_RANGE_RADIO)); AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION);
localized_strings->SetString(std::string("printToPDF"), AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_TO_PDF)); AddLocalizedString("morePrinters", IDS_PRINT_PREVIEW_MORE_PRINTERS);
localized_strings->SetString(std::string("printPreviewTitleFormat"), AddLocalizedString("addCloudPrinter", IDS_PRINT_PREVIEW_ADD_CLOUD_PRINTER);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_TITLE_FORMAT)); AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS);
localized_strings->SetString(std::string("printPreviewSummaryFormatShort"), AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SUMMARY_FORMAT_SHORT)); AddLocalizedString("manageCloudPrinters",
localized_strings->SetString(std::string("printPreviewSummaryFormatLong"), IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SUMMARY_FORMAT_LONG)); AddLocalizedString("manageLocalPrinters",
localized_strings->SetString(std::string("printPreviewSheetsLabelSingular"), IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SHEETS_LABEL_SINGULAR)); AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS);
localized_strings->SetString(std::string("printPreviewSheetsLabelPlural"), AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SHEETS_LABEL_PLURAL)); AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE);
localized_strings->SetString(std::string("printPreviewPageLabelSingular"), AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR));
localized_strings->SetString(std::string("printPreviewPageLabelPlural"), set_json_path("strings.js");
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL)); add_resource_path("print_preview.js", IDR_PRINT_PREVIEW_JS);
localized_strings->SetString(std::string("systemDialogOption"), set_default_resource(IDR_PRINT_PREVIEW_HTML);
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION));
localized_strings->SetString(std::string("pageRangeInstruction"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION));
localized_strings->SetString(std::string("copiesInstruction"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_COPIES_INSTRUCTION));
localized_strings->SetString(std::string("signIn"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_SIGN_IN));
localized_strings->SetString(std::string("morePrinters"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MORE_PRINTERS));
localized_strings->SetString(std::string("addCloudPrinter"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_ADD_CLOUD_PRINTER));
localized_strings->SetString(std::string("cloudPrinters"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_CLOUD_PRINTERS));
localized_strings->SetString(std::string("localPrinters"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_LOCAL_PRINTERS));
localized_strings->SetString(std::string("manageCloudPrinters"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS));
localized_strings->SetString(std::string("manageLocalPrinters"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS));
localized_strings->SetString(std::string("managePrinters"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_PRINTERS));
localized_strings->SetString(std::string("incrementTitle"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INCREMENT_TITLE));
localized_strings->SetString(std::string("decrementTitle"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_DECREMENT_TITLE));
localized_strings->SetString(std::string("printPagesLabel"),
l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL));
}
} // namespace
PrintPreviewDataSource::PrintPreviewDataSource()
: DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()) {
} }
PrintPreviewDataSource::~PrintPreviewDataSource() { PrintPreviewDataSource::~PrintPreviewDataSource() {
...@@ -142,46 +105,26 @@ PrintPreviewDataSource::~PrintPreviewDataSource() { ...@@ -142,46 +105,26 @@ PrintPreviewDataSource::~PrintPreviewDataSource() {
void PrintPreviewDataSource::StartDataRequest(const std::string& path, void PrintPreviewDataSource::StartDataRequest(const std::string& path,
bool is_incognito, bool is_incognito,
int request_id) { int request_id) {
scoped_refptr<RefCountedBytes> data; // Parent class handles most requests except for the print preview data.
if (!EndsWith(path, "/print.pdf", true)) {
bool preview_data_requested = EndsWith(path, "/print.pdf", true); ChromeWebUIDataSource::StartDataRequest(path, is_incognito, request_id);
if (preview_data_requested) { return;
std::vector<std::string> url_substr;
base::SplitString(path, '/', &url_substr);
int page_index = 0;
if (url_substr.size() == 3 && base::StringToInt(url_substr[1],
&page_index)) {
PrintPreviewDataService::GetInstance()->GetDataEntry(url_substr[0],
page_index, &data);
}
} }
if (path.empty()) { // Print Preview data.
// Print Preview Index page. scoped_refptr<RefCountedBytes> data;
DictionaryValue localized_strings; std::vector<std::string> url_substr;
SetLocalizedStrings(&localized_strings); base::SplitString(path, '/', &url_substr);
SetFontAndTextDirection(&localized_strings); int page_index = 0;
if (url_substr.size() == 3 && base::StringToInt(url_substr[1], &page_index)) {
static const base::StringPiece print_html( PrintPreviewDataService::GetInstance()->GetDataEntry(
ResourceBundle::GetSharedInstance().GetRawDataResource( url_substr[0], page_index, &data);
IDR_PRINT_PREVIEW_HTML)); }
std::string full_html = jstemplate_builder::GetI18nTemplateHtml( if (data.get()) {
print_html, &localized_strings);
SendResponse(request_id, base::RefCountedString::TakeString(&full_html));
return;
} else if (preview_data_requested && data.get()) {
// Print Preview data.
SendResponse(request_id, data); SendResponse(request_id, data);
return; return;
} else {
// Invalid request.
scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
SendResponse(request_id, empty_bytes);
return;
} }
} // Invalid request.
scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { SendResponse(request_id, empty_bytes);
return path.empty() ? "text/html" : "application/pdf";
} }
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
// PrintPreviewDataSource serves data for chrome://print requests. // PrintPreviewDataSource serves data for chrome://print requests.
// //
// The format for requesting data is as follows: // The format for requesting PDF data is as follows:
// chrome://print/<PrintPreviewUIAddrStr>/<PageIndex>/print.pdf // chrome://print/<PrintPreviewUIAddrStr>/<PageIndex>/print.pdf
// //
// Parameters (< > required): // Parameters (< > required):
...@@ -24,8 +25,10 @@ ...@@ -24,8 +25,10 @@
// //
// Example: // Example:
// chrome://print/0xab0123ef/10/print.pdf // chrome://print/0xab0123ef/10/print.pdf
//
class PrintPreviewDataSource : public ChromeURLDataManager::DataSource { // Requests to chrome://print with paths not ending in /print.pdf are used
// to return the markup or other resources for the print preview page itself.
class PrintPreviewDataSource : public ChromeWebUIDataSource {
public: public:
PrintPreviewDataSource(); PrintPreviewDataSource();
...@@ -33,8 +36,6 @@ class PrintPreviewDataSource : public ChromeURLDataManager::DataSource { ...@@ -33,8 +36,6 @@ class PrintPreviewDataSource : public ChromeURLDataManager::DataSource {
virtual void StartDataRequest(const std::string& path, virtual void StartDataRequest(const std::string& path,
bool is_incognito, bool is_incognito,
int request_id) OVERRIDE; int request_id) OVERRIDE;
virtual std::string GetMimeType(const std::string& path) const OVERRIDE;
private: private:
virtual ~PrintPreviewDataSource(); virtual ~PrintPreviewDataSource();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment