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

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

Issue 7976017: Simplified print preview printer selection to be more consistent with Chrome (Closed)
Patch Set: Fixed typo in comment Created 9 years, 3 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) 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 IDS_PRINT_PREVIEW_SUMMARY_FORMAT_LONG); 86 IDS_PRINT_PREVIEW_SUMMARY_FORMAT_LONG);
87 AddLocalizedString("printPreviewSheetsLabelSingular", 87 AddLocalizedString("printPreviewSheetsLabelSingular",
88 IDS_PRINT_PREVIEW_SHEETS_LABEL_SINGULAR); 88 IDS_PRINT_PREVIEW_SHEETS_LABEL_SINGULAR);
89 AddLocalizedString("printPreviewSheetsLabelPlural", 89 AddLocalizedString("printPreviewSheetsLabelPlural",
90 IDS_PRINT_PREVIEW_SHEETS_LABEL_PLURAL); 90 IDS_PRINT_PREVIEW_SHEETS_LABEL_PLURAL);
91 AddLocalizedString("printPreviewPageLabelSingular", 91 AddLocalizedString("printPreviewPageLabelSingular",
92 IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR); 92 IDS_PRINT_PREVIEW_PAGE_LABEL_SINGULAR);
93 AddLocalizedString("printPreviewPageLabelPlural", 93 AddLocalizedString("printPreviewPageLabelPlural",
94 IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL); 94 IDS_PRINT_PREVIEW_PAGE_LABEL_PLURAL);
95 const string16 shortcut_text(UTF8ToUTF16(kAdvancedPrintShortcut)); 95 const string16 shortcut_text(UTF8ToUTF16(kAdvancedPrintShortcut));
96 AddString("cloudPrintDialogOption", l10n_util::GetStringFUTF16(
kmadhusu 2011/09/23 20:30:07 Add line 96 within the #if defined(OS_CHROMEOS) E
Albert Bodenhamer 2011/09/23 22:10:56 Done.
97 IDS_PRINT_PREVIEW_CLOUD_DIALOG_OPTION,
98 shortcut_text));
96 AddString("systemDialogOption", l10n_util::GetStringFUTF16( 99 AddString("systemDialogOption", l10n_util::GetStringFUTF16(
97 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, 100 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION,
98 shortcut_text)); 101 shortcut_text));
99 102 #if defined(OS_CHROMEOS)
103 AddLocalizedString("printWithCloudPrint",
104 IDS_PRINT_PREVIEW_MORE_PRINTERS);
105 #else
106 AddLocalizedString("printWithCloudPrint",
107 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT);
108 #endif
100 AddLocalizedString("pageRangeInstruction", 109 AddLocalizedString("pageRangeInstruction",
101 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); 110 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION);
102 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); 111 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION);
103 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); 112 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN);
104 AddLocalizedString("cloudPrinters", IDS_PRINT_PREVIEW_CLOUD_PRINTERS);
105 AddLocalizedString("localPrinters", IDS_PRINT_PREVIEW_LOCAL_PRINTERS);
106 AddLocalizedString("manageCloudPrinters",
107 IDS_PRINT_PREVIEW_MANAGE_CLOUD_PRINTERS);
108 AddLocalizedString("manageLocalPrinters",
109 IDS_PRINT_PREVIEW_MANAGE_LOCAL_PRINTERS);
110 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); 113 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS);
111 AddLocalizedString("printWithCloudPrintWait", 114 AddLocalizedString("printWithCloudPrintWait",
112 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT); 115 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT);
113 AddLocalizedString("printWithCloudPrint",
114 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT);
115 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); 116 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE);
116 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); 117 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE);
117 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); 118 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL);
118 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); 119 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL);
119 AddLocalizedString("optionHeaderFooter", 120 AddLocalizedString("optionHeaderFooter",
120 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); 121 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER);
121 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); 122 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL);
122 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); 123 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS);
123 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); 124 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS);
124 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); 125 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS);
(...skipping 25 matching lines...) Expand all
150 url_substr[0], page_index, &data); 151 url_substr[0], page_index, &data);
151 } 152 }
152 if (data.get()) { 153 if (data.get()) {
153 SendResponse(request_id, data); 154 SendResponse(request_id, data);
154 return; 155 return;
155 } 156 }
156 // Invalid request. 157 // Invalid request.
157 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); 158 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
158 SendResponse(request_id, empty_bytes); 159 SendResponse(request_id, empty_bytes);
159 } 160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698