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

Side by Side Diff: chrome/browser/ui/webui/print_preview_data_source.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Refactored JS code Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/webui/print_preview_data_source.h" 5 #include "chrome/browser/ui/webui/print_preview_data_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS); 86 AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS);
87 AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS); 87 AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS);
88 AddLocalizedString("manageCloudPrinters", 88 AddLocalizedString("manageCloudPrinters",
89 IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS); 89 IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS);
90 AddLocalizedString("manageLocalPrinters", 90 AddLocalizedString("manageLocalPrinters",
91 IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS); 91 IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS);
92 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); 92 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS);
93 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); 93 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE);
94 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); 94 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE);
95 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); 95 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL);
96 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL);
97 AddLocalizedString("optionHeaderFooter",
98 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER);
96 99
97 set_json_path("strings.js"); 100 set_json_path("strings.js");
98 add_resource_path("print_preview.js", IDR_PRINT_PREVIEW_JS); 101 add_resource_path("print_preview.js", IDR_PRINT_PREVIEW_JS);
99 set_default_resource(IDR_PRINT_PREVIEW_HTML); 102 set_default_resource(IDR_PRINT_PREVIEW_HTML);
100 } 103 }
101 104
102 PrintPreviewDataSource::~PrintPreviewDataSource() { 105 PrintPreviewDataSource::~PrintPreviewDataSource() {
103 } 106 }
104 107
105 void PrintPreviewDataSource::StartDataRequest(const std::string& path, 108 void PrintPreviewDataSource::StartDataRequest(const std::string& path,
(...skipping 15 matching lines...) Expand all
121 url_substr[0], page_index, &data); 124 url_substr[0], page_index, &data);
122 } 125 }
123 if (data.get()) { 126 if (data.get()) {
124 SendResponse(request_id, data); 127 SendResponse(request_id, data);
125 return; 128 return;
126 } 129 }
127 // Invalid request. 130 // Invalid request.
128 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); 131 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
129 SendResponse(request_id, empty_bytes); 132 SendResponse(request_id, empty_bytes);
130 } 133 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698