Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / printing / printing_context_android.cc
index 5729267..64139c8 100644 (file)
@@ -61,8 +61,8 @@ void GetPageRanges(JNIEnv* env,
 namespace printing {
 
 // static
-PrintingContext* PrintingContext::Create(const std::string& app_locale) {
-  return new PrintingContextAndroid(app_locale);
+scoped_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) {
+  return make_scoped_ptr<PrintingContext>(new PrintingContextAndroid(delegate));
 }
 
 // static
@@ -71,8 +71,8 @@ void PrintingContextAndroid::PdfWritingDone(int fd, bool success) {
   Java_PrintingContext_pdfWritingDone(env, fd, success);
 }
 
-PrintingContextAndroid::PrintingContextAndroid(const std::string& app_locale)
-    : PrintingContext(app_locale) {
+PrintingContextAndroid::PrintingContextAndroid(Delegate* delegate)
+    : PrintingContext(delegate) {
   // The constructor is run in the IO thread.
 }
 
@@ -80,7 +80,6 @@ PrintingContextAndroid::~PrintingContextAndroid() {
 }
 
 void PrintingContextAndroid::AskUserForSettings(
-    gfx::NativeView parent_view,
     int max_pages,
     bool has_selection,
     const PrintSettingsCallback& callback) {
@@ -149,7 +148,8 @@ gfx::Size PrintingContextAndroid::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: "
@@ -170,7 +170,9 @@ gfx::Size PrintingContextAndroid::GetPdfPaperSizeDeviceUnits() {
 }
 
 PrintingContext::Result PrintingContextAndroid::UpdatePrinterSettings(
-    bool external_preview) {
+    bool external_preview,
+    bool show_system_dialog) {
+  DCHECK(!show_system_dialog);
   DCHECK(!in_print_job_);
 
   // Intentional No-op.