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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_ui.cc

Issue 2606043004: Perform printer setup on Chrome OS before selecting printer. (Closed)
Patch Set: address comments, fix tests Created 3 years, 11 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) 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/ref_counted_memory.h" 15 #include "base/memory/ref_counted_memory.h"
15 #include "base/metrics/histogram_macros.h" 16 #include "base/metrics/histogram_macros.h"
16 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/string_split.h" 18 #include "base/strings/string_split.h"
(...skipping 24 matching lines...) Expand all
42 #include "printing/features/features.h" 43 #include "printing/features/features.h"
43 #include "printing/page_size_margins.h" 44 #include "printing/page_size_margins.h"
44 #include "printing/print_job_constants.h" 45 #include "printing/print_job_constants.h"
45 #include "ui/base/l10n/l10n_util.h" 46 #include "ui/base/l10n/l10n_util.h"
46 #include "ui/gfx/geometry/rect.h" 47 #include "ui/gfx/geometry/rect.h"
47 #include "ui/web_dialogs/web_dialog_delegate.h" 48 #include "ui/web_dialogs/web_dialog_delegate.h"
48 #include "ui/web_dialogs/web_dialog_ui.h" 49 #include "ui/web_dialogs/web_dialog_ui.h"
49 50
50 #if defined(OS_CHROMEOS) 51 #if defined(OS_CHROMEOS)
51 #include "base/command_line.h" 52 #include "base/command_line.h"
52 #include "base/feature_list.h"
53 #include "chrome/common/chrome_features.h"
54 #include "chrome/common/chrome_switches.h" 53 #include "chrome/common/chrome_switches.h"
55 #endif 54 #endif
56 55
57 using content::WebContents; 56 using content::WebContents;
58 using printing::PageSizeMargins; 57 using printing::PageSizeMargins;
59 58
60 namespace { 59 namespace {
61 60
62 #if defined(OS_MACOSX) 61 #if defined(OS_MACOSX)
63 // U+0028 U+21E7 U+2318 U+0050 U+0029 in UTF8 62 // U+0028 U+21E7 U+2318 U+0050 U+0029 in UTF8
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 source->AddLocalizedString("selectButton", 227 source->AddLocalizedString("selectButton",
229 IDS_PRINT_PREVIEW_BUTTON_SELECT); 228 IDS_PRINT_PREVIEW_BUTTON_SELECT);
230 source->AddLocalizedString("goBackButton", 229 source->AddLocalizedString("goBackButton",
231 IDS_PRINT_PREVIEW_BUTTON_GO_BACK); 230 IDS_PRINT_PREVIEW_BUTTON_GO_BACK);
232 source->AddLocalizedString( 231 source->AddLocalizedString(
233 "resolveExtensionUSBPermissionMessage", 232 "resolveExtensionUSBPermissionMessage",
234 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_PERMISSION_MESSAGE); 233 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_PERMISSION_MESSAGE);
235 source->AddLocalizedString( 234 source->AddLocalizedString(
236 "resolveExtensionUSBErrorMessage", 235 "resolveExtensionUSBErrorMessage",
237 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_ERROR_MESSAGE); 236 IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_ERROR_MESSAGE);
237 source->AddLocalizedString(
238 "resolveCrosPrinterMessage",
239 IDS_PRINT_PREVIEW_RESOLVE_CROS_DESTINATION_MESSAGE);
238 const base::string16 shortcut_text(base::UTF8ToUTF16(kBasicPrintShortcut)); 240 const base::string16 shortcut_text(base::UTF8ToUTF16(kBasicPrintShortcut));
239 #if !defined(OS_CHROMEOS) 241 #if !defined(OS_CHROMEOS)
240 source->AddString( 242 source->AddString(
241 "systemDialogOption", 243 "systemDialogOption",
242 l10n_util::GetStringFUTF16( 244 l10n_util::GetStringFUTF16(
243 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION, 245 IDS_PRINT_PREVIEW_SYSTEM_DIALOG_OPTION,
244 shortcut_text)); 246 shortcut_text));
245 #endif 247 #endif
246 #if defined(OS_MACOSX) 248 #if defined(OS_MACOSX)
247 source->AddLocalizedString("openPdfInPreviewOption", 249 source->AddLocalizedString("openPdfInPreviewOption",
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698