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

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

Issue 10083060: [Print Preview]: Added code to support pdf fit to page functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update the function name in print_web_view_helper.h Created 8 years, 8 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) 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); 120 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION);
121 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); 121 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION);
122 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); 122 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN);
123 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); 123 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS);
124 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); 124 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE);
125 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); 125 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE);
126 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); 126 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL);
127 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); 127 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL);
128 AddLocalizedString("optionHeaderFooter", 128 AddLocalizedString("optionHeaderFooter",
129 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); 129 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER);
130 AddLocalizedString("optionFitToPage",
131 IDS_PRINT_PREVIEW_OPTION_FIT_TO_PAGE);
130 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); 132 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL);
131 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); 133 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS);
132 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); 134 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS);
133 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); 135 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS);
134 AddLocalizedString("minimumMargins", IDS_PRINT_PREVIEW_MINIMUM_MARGINS); 136 AddLocalizedString("minimumMargins", IDS_PRINT_PREVIEW_MINIMUM_MARGINS);
135 AddLocalizedString("top", IDS_PRINT_PREVIEW_TOP_MARGIN_LABEL); 137 AddLocalizedString("top", IDS_PRINT_PREVIEW_TOP_MARGIN_LABEL);
136 AddLocalizedString("bottom", IDS_PRINT_PREVIEW_BOTTOM_MARGIN_LABEL); 138 AddLocalizedString("bottom", IDS_PRINT_PREVIEW_BOTTOM_MARGIN_LABEL);
137 AddLocalizedString("left", IDS_PRINT_PREVIEW_LEFT_MARGIN_LABEL); 139 AddLocalizedString("left", IDS_PRINT_PREVIEW_LEFT_MARGIN_LABEL);
138 AddLocalizedString("right", IDS_PRINT_PREVIEW_RIGHT_MARGIN_LABEL); 140 AddLocalizedString("right", IDS_PRINT_PREVIEW_RIGHT_MARGIN_LABEL);
139 141
(...skipping 28 matching lines...) Expand all
168 url_substr[0], page_index, &data); 170 url_substr[0], page_index, &data);
169 } 171 }
170 if (data.get()) { 172 if (data.get()) {
171 SendResponse(request_id, data); 173 SendResponse(request_id, data);
172 return; 174 return;
173 } 175 }
174 // Invalid request. 176 // Invalid request.
175 scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes); 177 scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes);
176 SendResponse(request_id, empty_bytes); 178 SendResponse(request_id, empty_bytes);
177 } 179 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698