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

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

Issue 11818062: Adds option to enable CSS backgrounds for printing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sets should-print-backgrounds setting via print job workers. Created 7 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/print_preview_data_source.h" 5 #include "chrome/browser/ui/webui/print_preview/print_preview_data_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); 117 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION);
118 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); 118 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION);
119 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); 119 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE);
120 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); 120 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE);
121 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); 121 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL);
122 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); 122 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL);
123 AddLocalizedString("optionHeaderFooter", 123 AddLocalizedString("optionHeaderFooter",
124 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); 124 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER);
125 AddLocalizedString("optionFitToPage", 125 AddLocalizedString("optionFitToPage",
126 IDS_PRINT_PREVIEW_OPTION_FIT_TO_PAGE); 126 IDS_PRINT_PREVIEW_OPTION_FIT_TO_PAGE);
127 AddLocalizedString("optionBackgroundColorsAndImages",
128 IDS_PRINT_PREVIEW_OPTION_BACKGROUND_COLORS_AND_IMAGES);
127 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); 129 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL);
128 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); 130 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS);
129 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); 131 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS);
130 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); 132 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS);
131 AddLocalizedString("minimumMargins", IDS_PRINT_PREVIEW_MINIMUM_MARGINS); 133 AddLocalizedString("minimumMargins", IDS_PRINT_PREVIEW_MINIMUM_MARGINS);
132 AddLocalizedString("top", IDS_PRINT_PREVIEW_TOP_MARGIN_LABEL); 134 AddLocalizedString("top", IDS_PRINT_PREVIEW_TOP_MARGIN_LABEL);
133 AddLocalizedString("bottom", IDS_PRINT_PREVIEW_BOTTOM_MARGIN_LABEL); 135 AddLocalizedString("bottom", IDS_PRINT_PREVIEW_BOTTOM_MARGIN_LABEL);
134 AddLocalizedString("left", IDS_PRINT_PREVIEW_LEFT_MARGIN_LABEL); 136 AddLocalizedString("left", IDS_PRINT_PREVIEW_LEFT_MARGIN_LABEL);
135 AddLocalizedString("right", IDS_PRINT_PREVIEW_RIGHT_MARGIN_LABEL); 137 AddLocalizedString("right", IDS_PRINT_PREVIEW_RIGHT_MARGIN_LABEL);
136 AddLocalizedString("destinationSearchTitle", 138 AddLocalizedString("destinationSearchTitle",
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 preview_ui_id, page_index, &data); 216 preview_ui_id, page_index, &data);
215 } 217 }
216 if (data.get()) { 218 if (data.get()) {
217 SendResponse(request_id, data); 219 SendResponse(request_id, data);
218 return; 220 return;
219 } 221 }
220 // Invalid request. 222 // Invalid request.
221 scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes); 223 scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes);
222 SendResponse(request_id, empty_bytes); 224 SendResponse(request_id, empty_bytes);
223 } 225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698