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

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: Rebase + Fix nit Created 8 years, 7 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); 115 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION);
116 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); 116 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION);
117 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); 117 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN);
118 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); 118 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS);
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",
126 IDS_PRINT_PREVIEW_OPTION_FIT_TO_PAGE);
125 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); 127 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL);
126 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); 128 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS);
127 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); 129 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS);
128 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); 130 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS);
129 AddLocalizedString("minimumMargins", IDS_PRINT_PREVIEW_MINIMUM_MARGINS); 131 AddLocalizedString("minimumMargins", IDS_PRINT_PREVIEW_MINIMUM_MARGINS);
130 AddLocalizedString("top", IDS_PRINT_PREVIEW_TOP_MARGIN_LABEL); 132 AddLocalizedString("top", IDS_PRINT_PREVIEW_TOP_MARGIN_LABEL);
131 AddLocalizedString("bottom", IDS_PRINT_PREVIEW_BOTTOM_MARGIN_LABEL); 133 AddLocalizedString("bottom", IDS_PRINT_PREVIEW_BOTTOM_MARGIN_LABEL);
132 AddLocalizedString("left", IDS_PRINT_PREVIEW_LEFT_MARGIN_LABEL); 134 AddLocalizedString("left", IDS_PRINT_PREVIEW_LEFT_MARGIN_LABEL);
133 AddLocalizedString("right", IDS_PRINT_PREVIEW_RIGHT_MARGIN_LABEL); 135 AddLocalizedString("right", IDS_PRINT_PREVIEW_RIGHT_MARGIN_LABEL);
134 136
(...skipping 24 matching lines...) Expand all
159 url_substr[0], page_index, &data); 161 url_substr[0], page_index, &data);
160 } 162 }
161 if (data.get()) { 163 if (data.get()) {
162 SendResponse(request_id, data); 164 SendResponse(request_id, data);
163 return; 165 return;
164 } 166 }
165 // Invalid request. 167 // Invalid request.
166 scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes); 168 scoped_refptr<base::RefCountedBytes> empty_bytes(new base::RefCountedBytes);
167 SendResponse(request_id, empty_bytes); 169 SendResponse(request_id, empty_bytes);
168 } 170 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/browser/ui/webui/print_preview/print_preview_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698