From 5b2c0110dc02fe4c8d71766a219632be227c49a9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 Mar 2015 17:00:55 -0700 Subject: [PATCH] Fix other compilation errors --- atom/browser/ui/file_dialog_mac.mm | 1 + atom/common/crash_reporter/crash_reporter.cc | 4 ++-- atom/common/node_bindings.cc | 3 ++- .../chrome/browser/printing/print_job_worker.cc | 1 + .../chrome/renderer/printing/print_web_view_helper.cc | 1 - .../renderer/printing/print_web_view_helper_linux.cc | 11 +++-------- .../renderer/printing/print_web_view_helper_mac.mm | 9 +++------ .../printing/print_web_view_helper_pdf_win.cc | 11 +++-------- vendor/native_mate | 2 +- 9 files changed, 16 insertions(+), 27 deletions(-) diff --git a/atom/browser/ui/file_dialog_mac.mm b/atom/browser/ui/file_dialog_mac.mm index eff8506d85f5..9cd6c0380be6 100644 --- a/atom/browser/ui/file_dialog_mac.mm +++ b/atom/browser/ui/file_dialog_mac.mm @@ -9,6 +9,7 @@ #include "atom/browser/native_window.h" #include "base/files/file_util.h" +#include "base/mac/foundation_util.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/strings/sys_string_conversions.h" diff --git a/atom/common/crash_reporter/crash_reporter.cc b/atom/common/crash_reporter/crash_reporter.cc index 33b8235798ad..0a02086056b8 100644 --- a/atom/common/crash_reporter/crash_reporter.cc +++ b/atom/common/crash_reporter/crash_reporter.cc @@ -12,8 +12,8 @@ namespace crash_reporter { CrashReporter::CrashReporter() { - auto command_line = base::CommandLine::ForCurrentProcess(); - is_browser_ = command->GetSwitchValueASCII(switches::kProcessType).empty(); + auto cmd = base::CommandLine::ForCurrentProcess(); + is_browser_ = cmd->GetSwitchValueASCII(switches::kProcessType).empty(); } CrashReporter::~CrashReporter() { diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index ce77e58cedbe..b21c9b84ccec 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -112,7 +112,8 @@ std::vector String16VectorToStringVector( } #endif -base::FilePath GetResourcesPath(CommandLine* command_line, bool is_browser) { +base::FilePath GetResourcesPath(base::CommandLine* command_line, + bool is_browser) { base::FilePath exec_path(command_line->argv()[0]); PathService::Get(base::FILE_EXE, &exec_path); base::FilePath resources_path = diff --git a/chromium_src/chrome/browser/printing/print_job_worker.cc b/chromium_src/chrome/browser/printing/print_job_worker.cc index 37e61413584e..889ad6d2523f 100644 --- a/chromium_src/chrome/browser/printing/print_job_worker.cc +++ b/chromium_src/chrome/browser/printing/print_job_worker.cc @@ -192,6 +192,7 @@ void PrintJobWorker::GetSettingsWithUI( printing_context_->AskUserForSettings( document_page_count, has_selection, + false, base::Bind(&PrintJobWorker::GetSettingsWithUIDone, base::Unretained(this))); } diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc index 4e25da86296b..46718a0c546a 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc @@ -24,7 +24,6 @@ #include "net/base/escape.h" #include "printing/pdf_metafile_skia.h" #include "printing/units.h" -#include "skia/ext/vector_platform_device_skia.h" #include "third_party/WebKit/public/platform/WebSize.h" #include "third_party/WebKit/public/platform/WebURLRequest.h" #include "third_party/WebKit/public/web/WebConsoleMessage.h" diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc index c42467d45ccb..c35acd5b8e7f 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper_linux.cc @@ -130,16 +130,11 @@ void PrintWebViewHelper::PrintPageInternal( &content_area); gfx::Rect canvas_area = content_area; - SkBaseDevice* device = metafile->StartPageForVectorCanvas(page_size, - canvas_area, - scale_factor); - if (!device) + skia::PlatformCanvas* canvas = metafile->GetVectorCanvasForNewPage( + *page_size, canvas_area, scale_factor); + if (!canvas) return; - // The printPage method take a reference to the canvas we pass down, so it - // can't be a stack object. - skia::RefPtr canvas = - skia::AdoptRef(new skia::VectorCanvas(device)); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_); diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm b/chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm index 9565269a0bcb..e2ad3da5bc85 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper_mac.mm @@ -76,20 +76,17 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, gfx::Rect canvas_area = content_area; { - SkBaseDevice* device = metafile->StartPageForVectorCanvas( + skia::PlatformCanvas* canvas = metafile->GetVectorCanvasForNewPage( *page_size, canvas_area, scale_factor); - if (!device) + if (!canvas) return; - skia::RefPtr canvas = - skia::AdoptRef(new skia::VectorCanvas(device)); - blink::WebCanvas* canvas_ptr = canvas.get(); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_); skia::SetIsPreviewMetafile(*canvas, is_preview); RenderPageContent(frame, page_number, canvas_area, content_area, - scale_factor, canvas_ptr); + scale_factor, static_cast(canvas)); } // Done printing. Close the device context to retrieve the compiled metafile. diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc index 21e0c26e2848..0e82eb7606e2 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper_pdf_win.cc @@ -184,16 +184,11 @@ void PrintWebViewHelper::PrintPageInternal( frame->getPrintPageShrink(params.page_number); float scale_factor = css_scale_factor * webkit_page_shrink_factor; - SkBaseDevice* device = metafile->StartPageForVectorCanvas(page_size, - canvas_area, - scale_factor); - if (!device) + skia::PlatformCanvas* canvas = metafile->GetVectorCanvasForNewPage( + page_size, canvas_area, scale_factor); + if (!canvas) return; - // The printPage method take a reference to the canvas we pass down, so it - // can't be a stack object. - skia::RefPtr canvas = - skia::AdoptRef(new skia::VectorCanvas(device)); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_); diff --git a/vendor/native_mate b/vendor/native_mate index 21e76665a205..a636fad51e86 160000 --- a/vendor/native_mate +++ b/vendor/native_mate @@ -1 +1 @@ -Subproject commit 21e76665a20527ea0d7b21c2a2a1f310b660ffe9 +Subproject commit a636fad51e862d52c7bdb527c91300c85ed3c254