Minimum fixes needed for chromium_src
This commit is contained in:
parent
02d72c81af
commit
ce7c1023d5
10 changed files with 28 additions and 36 deletions
|
@ -124,7 +124,7 @@ static void AddPepperBasedWidevine(
|
|||
}
|
||||
|
||||
cdm::AddWidevineWithCodecs(
|
||||
cdm::WIDEVINE, supported_codecs,
|
||||
supported_codecs,
|
||||
#if defined(OS_CHROMEOS)
|
||||
media::EmeRobustness::HW_SECURE_ALL, // Maximum audio robustness.
|
||||
media::EmeRobustness::HW_SECURE_ALL, // Maximim video robustness.
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "third_party/WebKit/public/web/WebSettings.h"
|
||||
#include "third_party/WebKit/public/web/WebView.h"
|
||||
#include "third_party/WebKit/public/web/WebViewClient.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
using content::WebPreferences;
|
||||
|
@ -62,9 +63,9 @@ int GetDPI(const PrintMsg_Print_Params* print_params) {
|
|||
bool PrintMsg_Print_Params_IsValid(const PrintMsg_Print_Params& params) {
|
||||
return !params.content_size.IsEmpty() && !params.page_size.IsEmpty() &&
|
||||
!params.printable_area.IsEmpty() && params.document_cookie &&
|
||||
params.desired_dpi && params.max_shrink && params.min_shrink &&
|
||||
params.dpi && (params.margin_top >= 0) && (params.margin_left >= 0) &&
|
||||
params.dpi > kMinDpi && params.document_cookie != 0;
|
||||
params.desired_dpi && params.dpi && params.margin_top >= 0 &&
|
||||
params.margin_left >= 0 && params.dpi > kMinDpi &&
|
||||
params.document_cookie != 0;
|
||||
}
|
||||
|
||||
PrintMsg_Print_Params GetCssPrintParams(
|
||||
|
@ -425,8 +426,9 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
|
|||
blink::WebLocalFrame* parent,
|
||||
blink::WebTreeScopeType scope,
|
||||
const blink::WebString& name,
|
||||
blink::WebSandboxFlags sandboxFlags,
|
||||
const blink::WebFrameOwnerProperties& frameOwnerProperties) override;
|
||||
const blink::WebString& unique_name,
|
||||
blink::WebSandboxFlags sandbox_flags,
|
||||
const blink::WebFrameOwnerProperties& frame_owner_properties) override;
|
||||
void frameDetached(blink::WebFrame* frame, DetachType type) override;
|
||||
|
||||
private:
|
||||
|
@ -491,6 +493,7 @@ void PrepareFrameAndViewForPrint::ResizeForPrinting() {
|
|||
// think the page is 125% larger so the size of the page is correct for
|
||||
// minimum (default) scaling.
|
||||
// This is important for sites that try to fill the page.
|
||||
// The 1.25 value is |printingMinimumShrinkFactor|.
|
||||
gfx::Size print_layout_size(web_print_params_.printContentArea.width,
|
||||
web_print_params_.printContentArea.height);
|
||||
print_layout_size.set_height(
|
||||
|
@ -573,8 +576,9 @@ blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
|
|||
blink::WebLocalFrame* parent,
|
||||
blink::WebTreeScopeType scope,
|
||||
const blink::WebString& name,
|
||||
blink::WebSandboxFlags sandboxFlags,
|
||||
const blink::WebFrameOwnerProperties& frameOwnerProperties) {
|
||||
const blink::WebString& unique_name,
|
||||
blink::WebSandboxFlags sandbox_flags,
|
||||
const blink::WebFrameOwnerProperties& frame_owner_properties) {
|
||||
blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this);
|
||||
parent->appendChild(frame);
|
||||
return frame;
|
||||
|
@ -1263,11 +1267,7 @@ bool PrintWebViewHelper::PrintPreviewContext::CreatePreviewDocument(
|
|||
}
|
||||
|
||||
metafile_.reset(new PdfMetafileSkia);
|
||||
if (!metafile_->Init()) {
|
||||
set_error(PREVIEW_ERROR_METAFILE_INIT_FAILED);
|
||||
LOG(ERROR) << "PdfMetafileSkia Init failed";
|
||||
return false;
|
||||
}
|
||||
CHECK(metafile_->Init());
|
||||
|
||||
current_page_index_ = 0;
|
||||
pages_to_render_ = pages;
|
||||
|
|
|
@ -83,9 +83,9 @@ class PrintWebViewHelper
|
|||
PREVIEW_ERROR_NONE, // Always first.
|
||||
PREVIEW_ERROR_BAD_SETTING,
|
||||
PREVIEW_ERROR_METAFILE_COPY_FAILED,
|
||||
PREVIEW_ERROR_METAFILE_INIT_FAILED,
|
||||
PREVIEW_ERROR_METAFILE_INIT_FAILED_DEPRECATED,
|
||||
PREVIEW_ERROR_ZERO_PAGES,
|
||||
PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED,
|
||||
PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED_DEPRECATED,
|
||||
PREVIEW_ERROR_PAGE_RENDERED_WITHOUT_METAFILE,
|
||||
PREVIEW_ERROR_INVALID_PRINTER_SETTINGS,
|
||||
PREVIEW_ERROR_LAST_ENUM // Always last.
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
#include "chrome/common/print_messages.h"
|
||||
#include "printing/metafile_skia_wrapper.h"
|
||||
#include "printing/page_size_margins.h"
|
||||
#include "skia/ext/platform_device.h"
|
||||
#include "third_party/WebKit/public/platform/WebCanvas.h"
|
||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
|
@ -24,8 +24,7 @@ void PrintWebViewHelper::PrintPageInternal(
|
|||
const PrintMsg_PrintPage_Params& params,
|
||||
WebFrame* frame) {
|
||||
PdfMetafileSkia metafile;
|
||||
if (!metafile.Init())
|
||||
return;
|
||||
CHECK(metafile.Init());
|
||||
|
||||
int page_number = params.page_number;
|
||||
gfx::Size page_size_in_dpi;
|
||||
|
@ -63,12 +62,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
|||
|
||||
if (render_to_draft) {
|
||||
draft_metafile.reset(new PdfMetafileSkia());
|
||||
if (!draft_metafile->Init()) {
|
||||
print_preview_context_.set_error(
|
||||
PREVIEW_ERROR_MAC_DRAFT_METAFILE_INIT_FAILED);
|
||||
LOG(ERROR) << "Draft PdfMetafileSkia Init failed";
|
||||
return false;
|
||||
}
|
||||
CHECK(draft_metafile->Init());
|
||||
initial_render_metafile = draft_metafile.get();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue