Minimum fixes needed for chromium_src
This commit is contained in:
		
					parent
					
						
							
								02d72c81af
							
						
					
				
			
			
				commit
				
					
						ce7c1023d5
					
				
			
		
					 10 changed files with 28 additions and 36 deletions
				
			
		| 
						 | 
				
			
			@ -71,10 +71,6 @@ void RenderParamsFromPrintSettings(const PrintSettings& settings,
 | 
			
		|||
  params->margin_top = settings.page_setup_device_units().content_area().y();
 | 
			
		||||
  params->margin_left = settings.page_setup_device_units().content_area().x();
 | 
			
		||||
  params->dpi = settings.dpi();
 | 
			
		||||
  // Currently hardcoded at 1.25. See PrintSettings' constructor.
 | 
			
		||||
  params->min_shrink = settings.min_shrink();
 | 
			
		||||
  // Currently hardcoded at 2.0. See PrintSettings' constructor.
 | 
			
		||||
  params->max_shrink = settings.max_shrink();
 | 
			
		||||
  // Currently hardcoded at 72dpi. See PrintSettings' constructor.
 | 
			
		||||
  params->desired_dpi = settings.desired_dpi();
 | 
			
		||||
  // Always use an invalid cookie.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,7 +79,7 @@
 | 
			
		|||
#include "base/time/time.h"
 | 
			
		||||
#include "base/timer/timer.h"
 | 
			
		||||
#include "content/public/browser/browser_thread.h"
 | 
			
		||||
#include "net/base/net_util.h"
 | 
			
		||||
#include "net/base/network_interfaces.h"
 | 
			
		||||
#include "ui/base/l10n/l10n_util.h"
 | 
			
		||||
 | 
			
		||||
#if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,8 @@
 | 
			
		|||
 | 
			
		||||
#include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h"
 | 
			
		||||
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
 | 
			
		||||
#include "base/pickle.h"
 | 
			
		||||
#include "base/strings/utf_string_conversions.h"
 | 
			
		||||
#include "content/public/browser/browser_thread.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -48,10 +50,10 @@ ui::ClipboardType ConvertClipboardType(uint32_t type) {
 | 
			
		|||
// clipboard interface for custom data.
 | 
			
		||||
bool JumpToFormatInPickle(const base::string16& format,
 | 
			
		||||
                          base::PickleIterator* iter) {
 | 
			
		||||
  size_t size = 0;
 | 
			
		||||
  if (!iter->ReadSizeT(&size))
 | 
			
		||||
  uint32_t size = 0;
 | 
			
		||||
  if (!iter->ReadUInt32(&size))
 | 
			
		||||
    return false;
 | 
			
		||||
  for (size_t i = 0; i < size; ++i) {
 | 
			
		||||
  for (uint32_t i = 0; i < size; ++i) {
 | 
			
		||||
    base::string16 stored_format;
 | 
			
		||||
    if (!iter->ReadString16(&stored_format))
 | 
			
		||||
      return false;
 | 
			
		||||
| 
						 | 
				
			
			@ -83,7 +85,7 @@ std::string ReadDataFromPickle(const base::string16& format,
 | 
			
		|||
 | 
			
		||||
bool WriteDataToPickle(const std::map<base::string16, std::string>& data,
 | 
			
		||||
                       base::Pickle* pickle) {
 | 
			
		||||
  pickle->WriteSizeT(data.size());
 | 
			
		||||
  pickle->WriteUInt32(data.size());
 | 
			
		||||
  for (std::map<base::string16, std::string>::const_iterator it = data.begin();
 | 
			
		||||
       it != data.end();
 | 
			
		||||
       ++it) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@
 | 
			
		|||
#include "content/public/browser/child_process_security_policy.h"
 | 
			
		||||
#include "content/public/browser/render_frame_host.h"
 | 
			
		||||
#include "content/public/common/pepper_plugin_info.h"
 | 
			
		||||
#include "net/base/net_util.h"
 | 
			
		||||
#include "net/base/network_interfaces.h"
 | 
			
		||||
#include "ppapi/c/pp_errors.h"
 | 
			
		||||
#include "ppapi/host/dispatch_host_message.h"
 | 
			
		||||
#include "ppapi/host/host_message_context.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,7 +27,7 @@
 | 
			
		|||
#include "build/build_config.h"
 | 
			
		||||
#include "net/base/ip_endpoint.h"
 | 
			
		||||
#include "net/base/net_errors.h"
 | 
			
		||||
#include "net/base/net_util.h"
 | 
			
		||||
#include "net/base/network_interfaces.h"
 | 
			
		||||
#include "net/base/sockaddr_storage.h"
 | 
			
		||||
#include "net/socket/socket_descriptor.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,7 +22,7 @@
 | 
			
		|||
#include "base/sys_byteorder.h"
 | 
			
		||||
#include "base/threading/platform_thread.h"
 | 
			
		||||
#include "build/build_config.h"
 | 
			
		||||
#include "net/base/net_util.h"
 | 
			
		||||
#include "net/base/network_interfaces.h"
 | 
			
		||||
#include "net/base/winsock_init.h"
 | 
			
		||||
#include "net/socket/socket_descriptor.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue