diff options
author | Vitaly Buka <vitalybuka@chromium.org> | 2014-08-26 01:57:54 -0700 |
---|---|---|
committer | Vitaly Buka <vitalybuka@chromium.org> | 2014-08-26 09:00:31 +0000 |
commit | bd7c981343caf492e552ae6c9498a15bbc38f1c7 (patch) | |
tree | db09e4d4292f5ca88788635fe0e1f1439f4d9106 /printing/printing_context_no_system_dialog.cc | |
parent | 4d18cc81f71b4edf191e359526224080e275d65e (diff) | |
download | chromium_src-bd7c981343caf492e552ae6c9498a15bbc38f1c7.zip chromium_src-bd7c981343caf492e552ae6c9498a15bbc38f1c7.tar.gz chromium_src-bd7c981343caf492e552ae6c9498a15bbc38f1c7.tar.bz2 |
Added PrintingContext::Delegate to get parent view handle and application locale.
BUG=374321
Committed: https://chromium.googlesource.com/chromium/src/+/ee8f4e4029c09ba77e7dbb8fddd85186642b3de8
R=jschuh@chromium.org, noamsml@chromium.org, thestig@chromium.org, yzshen@chromium.org
Review URL: https://codereview.chromium.org/478183005
Cr-Commit-Position: refs/heads/master@{#291871}
Diffstat (limited to 'printing/printing_context_no_system_dialog.cc')
-rw-r--r-- | printing/printing_context_no_system_dialog.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/printing/printing_context_no_system_dialog.cc b/printing/printing_context_no_system_dialog.cc index 4768e4d..fd6e166 100644 --- a/printing/printing_context_no_system_dialog.cc +++ b/printing/printing_context_no_system_dialog.cc @@ -15,13 +15,13 @@ namespace printing { // static -PrintingContext* PrintingContext::Create(const std::string& app_locale) { - return static_cast<PrintingContext*>( - new PrintingContextNoSystemDialog(app_locale)); +scoped_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) { + return make_scoped_ptr<PrintingContext>( + new PrintingContextNoSystemDialog(delegate)); } -PrintingContextNoSystemDialog::PrintingContextNoSystemDialog( - const std::string& app_locale) : PrintingContext(app_locale) { +PrintingContextNoSystemDialog::PrintingContextNoSystemDialog(Delegate* delegate) + : PrintingContext(delegate) { } PrintingContextNoSystemDialog::~PrintingContextNoSystemDialog() { @@ -29,7 +29,6 @@ PrintingContextNoSystemDialog::~PrintingContextNoSystemDialog() { } void PrintingContextNoSystemDialog::AskUserForSettings( - gfx::NativeView parent_view, int max_pages, bool has_selection, const PrintSettingsCallback& callback) { @@ -54,7 +53,8 @@ gfx::Size PrintingContextNoSystemDialog::GetPdfPaperSizeDeviceUnits() { int32_t width = 0; int32_t height = 0; UErrorCode error = U_ZERO_ERROR; - ulocdata_getPaperSize(app_locale_.c_str(), &height, &width, &error); + ulocdata_getPaperSize( + delegate_->GetAppLocale().c_str(), &height, &width, &error); if (error > U_ZERO_ERROR) { // If the call failed, assume a paper size of 8.5 x 11 inches. LOG(WARNING) << "ulocdata_getPaperSize failed, using 8.5 x 11, error: " |