| OLD | NEW |
| 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_ui.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 using content::WebContents; | 57 using content::WebContents; |
| 58 using printing::PageSizeMargins; | 58 using printing::PageSizeMargins; |
| 59 | 59 |
| 60 namespace { | 60 namespace { |
| 61 | 61 |
| 62 #if defined(OS_MACOSX) | 62 #if defined(OS_MACOSX) |
| 63 // U+0028 U+21E7 U+2318 U+0050 U+0029 in UTF8 | 63 // U+0028 U+21E7 U+2318 U+0050 U+0029 in UTF8 |
| 64 const char kBasicPrintShortcut[] = "\x28\xE2\x8c\xA5\xE2\x8C\x98\x50\x29"; | 64 const char kBasicPrintShortcut[] = "\x28\xE2\x8c\xA5\xE2\x8C\x98\x50\x29"; |
| 65 #else | 65 #elif !defined(OS_CHROMEOS) |
| 66 const char kBasicPrintShortcut[] = "(Ctrl+Shift+P)"; | 66 const char kBasicPrintShortcut[] = "(Ctrl+Shift+P)"; |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 // Thread-safe wrapper around a std::map to keep track of mappings from | 69 // Thread-safe wrapper around a std::map to keep track of mappings from |
| 70 // PrintPreviewUI IDs to most recent print preview request IDs. | 70 // PrintPreviewUI IDs to most recent print preview request IDs. |
| 71 class PrintPreviewRequestIdMapWithLock { | 71 class PrintPreviewRequestIdMapWithLock { |
| 72 public: | 72 public: |
| 73 PrintPreviewRequestIdMapWithLock() {} | 73 PrintPreviewRequestIdMapWithLock() {} |
| 74 ~PrintPreviewRequestIdMapWithLock() {} | 74 ~PrintPreviewRequestIdMapWithLock() {} |
| 75 | 75 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 source->AddLocalizedString("selectButton", | 228 source->AddLocalizedString("selectButton", |
| 229 IDS_PRINT_PREVIEW_BUTTON_SELECT); | 229 IDS_PRINT_PREVIEW_BUTTON_SELECT); |
| 230 source->AddLocalizedString("goBackButton", | 230 source->AddLocalizedString("goBackButton", |
| 231 IDS_PRINT_PREVIEW_BUTTON_GO_BACK); | 231 IDS_PRINT_PREVIEW_BUTTON_GO_BACK); |
| 232 source->AddLocalizedString( | 232 source->AddLocalizedString( |
| 233 "resolveExtensionUSBPermissionMessage", | 233 "resolveExtensionUSBPermissionMessage", |
| 234 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_PERMISSION_MESSAGE); | 234 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_PERMISSION_MESSAGE); |
| 235 source->AddLocalizedString( | 235 source->AddLocalizedString( |
| 236 "resolveExtensionUSBErrorMessage", | 236 "resolveExtensionUSBErrorMessage", |
| 237 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_ERROR_MESSAGE); | 237 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_ERROR_MESSAGE); |
| 238 source->AddLocalizedString( | 238 #if defined(OS_CHROMEOS) |
| 239 "resolveCrosPrinterMessage", | 239 source->AddLocalizedString("configuringInProgressText", |
| 240 IDS_PRINT_PREVIEW_RESOLVE_CROS_DESTINATION_MESSAGE); | 240 IDS_PRINT_CONFIGURING_IN_PROGRESS_TEXT); |
| 241 source->AddLocalizedString("configuringFailedText", |
| 242 IDS_PRINT_CONFIGURING_FAILED_TEXT); |
| 243 #else |
| 241 const base::string16 shortcut_text(base::UTF8ToUTF16(kBasicPrintShortcut)); | 244 const base::string16 shortcut_text(base::UTF8ToUTF16(kBasicPrintShortcut)); |
| 242 #if !defined(OS_CHROMEOS) | |
| 243 source->AddString( | 245 source->AddString( |
| 244 "systemDialogOption", | 246 "systemDialogOption", |
| 245 l10n_util::GetStringFUTF16( | 247 l10n_util::GetStringFUTF16( |
| 246 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, | 248 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, |
| 247 shortcut_text)); | 249 shortcut_text)); |
| 248 #endif | 250 #endif |
| 249 #if defined(OS_MACOSX) | 251 #if defined(OS_MACOSX) |
| 250 source->AddLocalizedString("openPdfInPreviewOption", | 252 source->AddLocalizedString("openPdfInPreviewOption", |
| 251 IDS_PRINT_PREVIEW_OPEN_PDF_IN_PREVIEW_APP); | 253 IDS_PRINT_PREVIEW_OPEN_PDF_IN_PREVIEW_APP); |
| 252 #endif | 254 #endif |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 } | 691 } |
| 690 | 692 |
| 691 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { | 693 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { |
| 692 handler_->FileSelected(path, 0, NULL); | 694 handler_->FileSelected(path, 0, NULL); |
| 693 } | 695 } |
| 694 | 696 |
| 695 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 697 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
| 696 const base::Closure& closure) { | 698 const base::Closure& closure) { |
| 697 handler_->SetPdfSavedClosureForTesting(closure); | 699 handler_->SetPdfSavedClosureForTesting(closure); |
| 698 } | 700 } |
| OLD | NEW |