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

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: Rebased and moved PrintHeaderAndFooter to private member function. 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 localized_strings->SetString(std::string("manageLocalPrinters"), 121 localized_strings->SetString(std::string("manageLocalPrinters"),
122 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS)); 122 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS));
123 localized_strings->SetString(std::string("managePrinters"), 123 localized_strings->SetString(std::string("managePrinters"),
124 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_PRINTERS)); 124 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_MANAGE_PRINTERS));
125 localized_strings->SetString(std::string("incrementTitle"), 125 localized_strings->SetString(std::string("incrementTitle"),
126 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INCREMENT_TITLE)); 126 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_INCREMENT_TITLE));
127 localized_strings->SetString(std::string("decrementTitle"), 127 localized_strings->SetString(std::string("decrementTitle"),
128 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_DECREMENT_TITLE)); 128 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_DECREMENT_TITLE));
129 localized_strings->SetString(std::string("printPagesLabel"), 129 localized_strings->SetString(std::string("printPagesLabel"),
130 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL)); 130 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL));
131 localized_strings->SetString(std::string("optionsLabel"),
132 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTIONS_LABEL));
133 localized_strings->SetString(std::string("optionHeaderFooter"),
134 l10n_util::GetStringUTF8(IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER));
131 } 135 }
132 136
133 } // namespace 137 } // namespace
134 138
135 PrintPreviewDataSource::PrintPreviewDataSource() 139 PrintPreviewDataSource::PrintPreviewDataSource()
136 : DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()) { 140 : DataSource(chrome::kChromeUIPrintHost, MessageLoop::current()) {
137 } 141 }
138 142
139 PrintPreviewDataSource::~PrintPreviewDataSource() { 143 PrintPreviewDataSource::~PrintPreviewDataSource() {
140 } 144 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Invalid request. 182 // Invalid request.
179 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); 183 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
180 SendResponse(request_id, empty_bytes); 184 SendResponse(request_id, empty_bytes);
181 return; 185 return;
182 } 186 }
183 } 187 }
184 188
185 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const { 189 std::string PrintPreviewDataSource::GetMimeType(const std::string& path) const {
186 return path.empty() ? "text/html" : "application/pdf"; 190 return path.empty() ? "text/html" : "application/pdf";
187 } 191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698