| 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 <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/feature_list.h" | 11 #include "base/feature_list.h" |
| 11 #include "base/id_map.h" | 12 #include "base/id_map.h" |
| 12 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 15 #include "base/memory/ref_counted_memory.h" | 16 #include "base/memory/ref_counted_memory.h" |
| 16 #include "base/metrics/histogram_macros.h" | 17 #include "base/metrics/histogram_macros.h" |
| 17 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 43 #include "printing/features/features.h" | 44 #include "printing/features/features.h" |
| 44 #include "printing/page_size_margins.h" | 45 #include "printing/page_size_margins.h" |
| 45 #include "printing/print_job_constants.h" | 46 #include "printing/print_job_constants.h" |
| 46 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
| 47 #include "ui/gfx/geometry/rect.h" | 48 #include "ui/gfx/geometry/rect.h" |
| 48 #include "ui/web_dialogs/web_dialog_delegate.h" | 49 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 49 #include "ui/web_dialogs/web_dialog_ui.h" | 50 #include "ui/web_dialogs/web_dialog_ui.h" |
| 50 | 51 |
| 51 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
| 52 #include "base/command_line.h" | 53 #include "base/command_line.h" |
| 53 #include "base/feature_list.h" | |
| 54 #include "chrome/common/chrome_features.h" | |
| 55 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
| 56 #endif | 55 #endif |
| 57 | 56 |
| 58 using content::WebContents; | 57 using content::WebContents; |
| 59 using printing::PageSizeMargins; | 58 using printing::PageSizeMargins; |
| 60 | 59 |
| 61 namespace { | 60 namespace { |
| 62 | 61 |
| 63 #if defined(OS_MACOSX) | 62 #if defined(OS_MACOSX) |
| 64 // 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 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 source->AddLocalizedString("selectButton", | 228 source->AddLocalizedString("selectButton", |
| 230 IDS_PRINT_PREVIEW_BUTTON_SELECT); | 229 IDS_PRINT_PREVIEW_BUTTON_SELECT); |
| 231 source->AddLocalizedString("goBackButton", | 230 source->AddLocalizedString("goBackButton", |
| 232 IDS_PRINT_PREVIEW_BUTTON_GO_BACK); | 231 IDS_PRINT_PREVIEW_BUTTON_GO_BACK); |
| 233 source->AddLocalizedString( | 232 source->AddLocalizedString( |
| 234 "resolveExtensionUSBPermissionMessage", | 233 "resolveExtensionUSBPermissionMessage", |
| 235 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_PERMISSION_MESSAGE); | 234 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_PERMISSION_MESSAGE); |
| 236 source->AddLocalizedString( | 235 source->AddLocalizedString( |
| 237 "resolveExtensionUSBErrorMessage", | 236 "resolveExtensionUSBErrorMessage", |
| 238 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_ERROR_MESSAGE); | 237 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_ERROR_MESSAGE); |
| 238 source->AddLocalizedString( |
| 239 "resolveCrosPrinterMessage", |
| 240 IDS_PRINT_PREVIEW_RESOLVE_CROS_DESTINATION_MESSAGE); |
| 239 const base::string16 shortcut_text(base::UTF8ToUTF16(kBasicPrintShortcut)); | 241 const base::string16 shortcut_text(base::UTF8ToUTF16(kBasicPrintShortcut)); |
| 240 #if !defined(OS_CHROMEOS) | 242 #if !defined(OS_CHROMEOS) |
| 241 source->AddString( | 243 source->AddString( |
| 242 "systemDialogOption", | 244 "systemDialogOption", |
| 243 l10n_util::GetStringFUTF16( | 245 l10n_util::GetStringFUTF16( |
| 244 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, | 246 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, |
| 245 shortcut_text)); | 247 shortcut_text)); |
| 246 #endif | 248 #endif |
| 247 #if defined(OS_MACOSX) | 249 #if defined(OS_MACOSX) |
| 248 source->AddLocalizedString("openPdfInPreviewOption", | 250 source->AddLocalizedString("openPdfInPreviewOption", |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 } | 695 } |
| 694 | 696 |
| 695 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { | 697 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { |
| 696 handler_->FileSelected(path, 0, NULL); | 698 handler_->FileSelected(path, 0, NULL); |
| 697 } | 699 } |
| 698 | 700 |
| 699 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 701 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
| 700 const base::Closure& closure) { | 702 const base::Closure& closure) { |
| 701 handler_->SetPdfSavedClosureForTesting(closure); | 703 handler_->SetPdfSavedClosureForTesting(closure); |
| 702 } | 704 } |
| OLD | NEW |