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

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 flow in chrome 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 #if defined(OS_CHROMEOS)
97 AddLocalizedString("systemDialogOption",
kmadhusu 2011/09/21 21:57:41 "systemDialogOption" is a just a escape hatch to u
Albert Bodenhamer 2011/09/22 23:23:39 On Chrome OS, cloud print IS the system print dial
kmadhusu 2011/09/23 01:27:19 Thanks for the clarification. On Chrome OS, if you
Albert Bodenhamer 2011/09/23 16:34:25 The link actually triggers the system print dialog
98 IDS_PRINT_PREVIEW_CLOUD_DIALOG_OPTION);
99 AddLocalizedString("printWithCloudPrint",
100 IDS_PRINT_PREVIEW_MORE_PRINTERS);
101 #else
96 AddString("systemDialogOption", l10n_util::GetStringFUTF16( 102 AddString("systemDialogOption", l10n_util::GetStringFUTF16(
97 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, 103 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION,
98 shortcut_text)); 104 shortcut_text));
99 105 AddLocalizedString("printWithCloudPrint",
106 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT);
kmadhusu 2011/09/21 21:57:41 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT is a form
Albert Bodenhamer 2011/09/22 23:23:39 It has a non-translatable section for the service
kmadhusu 2011/09/23 01:27:19 I thought <ph> tags (place holder tags) allows us
Albert Bodenhamer 2011/09/23 16:34:25 Strangely, I'm having a hard time finding public d
107 #endif
100 AddLocalizedString("pageRangeInstruction", 108 AddLocalizedString("pageRangeInstruction",
101 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); 109 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION);
102 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); 110 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION);
103 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); 111 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); 112 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS);
111 AddLocalizedString("printWithCloudPrintWait", 113 AddLocalizedString("printWithCloudPrintWait",
112 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT); 114 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); 115 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE);
116 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); 116 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE);
117 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); 117 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL);
118 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL); 118 AddLocalizedString("optionsLabel", IDS_PRINT_PREVIEW_OPTIONS_LABEL);
119 AddLocalizedString("optionHeaderFooter", 119 AddLocalizedString("optionHeaderFooter",
120 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER); 120 IDS_PRINT_PREVIEW_OPTION_HEADER_FOOTER);
121 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL); 121 AddLocalizedString("marginsLabel", IDS_PRINT_PREVIEW_MARGINS_LABEL);
122 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS); 122 AddLocalizedString("defaultMargins", IDS_PRINT_PREVIEW_DEFAULT_MARGINS);
123 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS); 123 AddLocalizedString("noMargins", IDS_PRINT_PREVIEW_NO_MARGINS);
124 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS); 124 AddLocalizedString("customMargins", IDS_PRINT_PREVIEW_CUSTOM_MARGINS);
(...skipping 25 matching lines...) Expand all
150 url_substr[0], page_index, &data); 150 url_substr[0], page_index, &data);
151 } 151 }
152 if (data.get()) { 152 if (data.get()) {
153 SendResponse(request_id, data); 153 SendResponse(request_id, data);
154 return; 154 return;
155 } 155 }
156 // Invalid request. 156 // Invalid request.
157 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); 157 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
158 SendResponse(request_id, empty_bytes); 158 SendResponse(request_id, empty_bytes);
159 } 159 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698