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

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: '' 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED); 55 IDS_PRINT_PREVIEW_INITIATOR_TAB_CRASHED);
56 AddLocalizedString("initiatorTabClosed", 56 AddLocalizedString("initiatorTabClosed",
57 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED); 57 IDS_PRINT_PREVIEW_INITIATOR_TAB_CLOSED);
58 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE); 58 AddLocalizedString("reopenPage", IDS_PRINT_PREVIEW_REOPEN_PAGE);
59 59
60 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); 60 AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON);
61 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON); 61 AddLocalizedString("cancelButton", IDS_PRINT_PREVIEW_CANCEL_BUTTON);
62 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); 62 AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING);
63 AddLocalizedString("printingToPDFInProgress", 63 AddLocalizedString("printingToPDFInProgress",
64 IDS_PRINT_PREVIEW_PRINTING_TO_PDF_IN_PROGRESS); 64 IDS_PRINT_PREVIEW_PRINTING_TO_PDF_IN_PROGRESS);
65 65 #if defined(OS_MACOSX)
66 AddLocalizedString("openingPDFInPreview",
67 IDS_PRINT_PREVIEW_OPENING_PDF_IN_PREVIEW);
68 #endif
66 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL); 69 AddLocalizedString("destinationLabel", IDS_PRINT_PREVIEW_DESTINATION_LABEL);
67 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL); 70 AddLocalizedString("copiesLabel", IDS_PRINT_PREVIEW_COPIES_LABEL);
68 AddLocalizedString("examplePageRangeText", 71 AddLocalizedString("examplePageRangeText",
69 IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT); 72 IDS_PRINT_PREVIEW_EXAMPLE_PAGE_RANGE_TEXT);
70 AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL); 73 AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL);
71 AddLocalizedString("optionAllPages", IDS_PRINT_PREVIEW_OPTION_ALL_PAGES); 74 AddLocalizedString("optionAllPages", IDS_PRINT_PREVIEW_OPTION_ALL_PAGES);
72 AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW); 75 AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW);
73 AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE); 76 AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE);
74 AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR); 77 AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR);
75 AddLocalizedString("optionLandscape", IDS_PRINT_PREVIEW_OPTION_LANDSCAPE); 78 AddLocalizedString("optionLandscape", IDS_PRINT_PREVIEW_OPTION_LANDSCAPE);
(...skipping 23 matching lines...) Expand all
99 shortcut_text)); 102 shortcut_text));
100 AddLocalizedString("printWithCloudPrint", 103 AddLocalizedString("printWithCloudPrint",
101 IDS_PRINT_PREVIEW_MORE_PRINTERS); 104 IDS_PRINT_PREVIEW_MORE_PRINTERS);
102 #else 105 #else
103 AddString("systemDialogOption", l10n_util::GetStringFUTF16( 106 AddString("systemDialogOption", l10n_util::GetStringFUTF16(
104 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, 107 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION,
105 shortcut_text)); 108 shortcut_text));
106 AddLocalizedString("printWithCloudPrint", 109 AddLocalizedString("printWithCloudPrint",
107 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT); 110 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT);
108 #endif 111 #endif
112 #if defined(OS_MACOSX)
113 AddLocalizedString("openPdfInPreviewOption",
114 IDS_PRINT_PREVIEW_OPEN_PDF_IN_PREVIEW_APP);
115 #endif
109 AddLocalizedString("pageRangeInstruction", 116 AddLocalizedString("pageRangeInstruction",
110 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION); 117 IDS_PRINT_PREVIEW_PAGE_RANGE_INSTRUCTION);
111 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION); 118 AddLocalizedString("copiesInstruction", IDS_PRINT_PREVIEW_COPIES_INSTRUCTION);
112 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN); 119 AddLocalizedString("signIn", IDS_PRINT_PREVIEW_SIGN_IN);
113 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS); 120 AddLocalizedString("managePrinters", IDS_PRINT_PREVIEW_MANAGE_PRINTERS);
114 AddLocalizedString("printWithCloudPrintWait", 121 AddLocalizedString("printWithCloudPrintWait",
115 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT); 122 IDS_PRINT_PREVIEW_PRINT_WITH_CLOUD_PRINT_WAIT);
116 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE); 123 AddLocalizedString("incrementTitle", IDS_PRINT_PREVIEW_INCREMENT_TITLE);
117 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE); 124 AddLocalizedString("decrementTitle", IDS_PRINT_PREVIEW_DECREMENT_TITLE);
118 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL); 125 AddLocalizedString("printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 url_substr[0], page_index, &data); 163 url_substr[0], page_index, &data);
157 } 164 }
158 if (data.get()) { 165 if (data.get()) {
159 SendResponse(request_id, data); 166 SendResponse(request_id, data);
160 return; 167 return;
161 } 168 }
162 // Invalid request. 169 // Invalid request.
163 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes); 170 scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
164 SendResponse(request_id, empty_bytes); 171 SendResponse(request_id, empty_bytes);
165 } 172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698