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

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

Issue 8425008: PrintPreview:[MAC] Added "Open PDF In Preview" option to open the pdf in native preview app. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added a check to fix the TestErrorMessage unit test Created 9 years, 1 month 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) 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 #include <vector> 8 #include <vector>
9 9
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #endif 49 #endif
50 AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG); 50 AddLocalizedString("launchNativeDialog", IDS_PRINT_PREVIEW_NATIVE_DIALOG);
51 AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED); 51 AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED);
52 AddLocalizedString("invalidPrinterSettings", 52 AddLocalizedString("invalidPrinterSettings",
53 IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS); 53 IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS);
54 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); 54 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON);
55 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); 55 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON);
56 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); 56 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING);
57 AddLocalizedString("printingToPDFInProgress", 57 AddLocalizedString("printingToPDFInProgress",
58 IDS_PRINT_PREVIEW_PRINTING_TO_PDF_IN_PROGRESS); 58 IDS_PRINT_PREVIEW_PRINTING_TO_PDF_IN_PROGRESS);
59 59 #if defined(OS_MACOSX)
60 AddLocalizedString("openingPDFInPreview",
61 IDS_PRINT_PREVIEW_OPENING_PDF_IN_PREVIEW);
62 #endif
60 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL); 63 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL);
61 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL); 64 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL);
62 AddLocalizedString("examplePageRangeText", 65 AddLocalizedString("examplePageRangeText",
63 IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT); 66 IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT);
64 AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL); 67 AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL);
65 AddLocalizedString("optionAllPages", IDS_PRINT_PREVIEW_OPTION_ALL_PAGES); 68 AddLocalizedString("optionAllPages", IDS_PRINT_PREVIEW_OPTION_ALL_PAGES);
66 AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW); 69 AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW);
67 AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE); 70 AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE);
68 AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR); 71 AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR);
69 AddLocalizedString("optionLandscape", IDS_PRINT_PREVIEW_OPTION_LANDSCAPE); 72 AddLocalizedString("optionLandscape", IDS_PRINT_PREVIEW_OPTION_LANDSCAPE);
(...skipping 23 matching lines...) Expand all
93 shortcut_text)); 96 shortcut_text));
94 AddLocalizedString("printWithCloudPrint", 97 AddLocalizedString("printWithCloudPrint",
95 IDS_PRINT_PREVIEW_MORE_PRINTERS); 98 IDS_PRINT_PREVIEW_MORE_PRINTERS);
96 #else 99 #else
97 AddString("systemDialogOption", l10n_util::GetStringFUTF16( 100 AddString("systemDialogOption", l10n_util::GetStringFUTF16(
98 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, 101 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION,
99 shortcut_text)); 102 shortcut_text));
100 AddLocalizedString("printWithCloudPrint", 103 AddLocalizedString("printWithCloudPrint",
101 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT); 104 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT);
102 #endif 105 #endif
106 #if defined(OS_MACOSX)
107 AddLocalizedString("openPdfInPreviewOption",
108 IDS_PRINT_PREVIEW_OPEN_PDF_IN_PREVIEW_APP);
109 #endif
103 AddLocalizedString("pageRangeInstruction", 110 AddLocalizedString("pageRangeInstruction",
104 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); 111 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION);
105 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); 112 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION);
106 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); 113 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN);
107 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); 114 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS);
108 AddLocalizedString("printWithCloudPrintWait", 115 AddLocalizedString("printWithCloudPrintWait",
109 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT); 116 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT);
110 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); 117 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE);
111 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); 118 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE);
112 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); 119 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 url_substr[0], page_index, &data); 157 url_substr[0], page_index, &data);
151 } 158 }
152 if (data.get()) { 159 if (data.get()) {
153 SendResponse(request_id, data); 160 SendResponse(request_id, data);
154 return; 161 return;
155 } 162 }
156 // Invalid request. 163 // Invalid request.
157 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); 164 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
158 SendResponse(request_id, empty_bytes); 165 SendResponse(request_id, empty_bytes);
159 } 166 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/browser/ui/webui/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698