[Print Preview]: Added code to support pdf fit to page functionality.

BUG=85132
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10083060

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137498 0039d316-1c4b-4281-b951-d872f2087c98
bool PrintWebViewHelper::InitPrintSettings() {
  PrintMsg_PrintPages_Params settings;
  Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
                                                &settings.params));
  bool result = true;
  if (!PrintMsg_Print_Params_IsValid(settings.params))
    result = false;

  if (result &&
      (settings.params.dpi < kMinDpi || settings.params.document_cookie == 0)) {
    NOTREACHED();
    result = false;
  }

  ignore_css_margins_ = false;
  settings.params.fit_to_paper_size = true;
  settings.pages.clear();

  print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings));
  return result;
}

bool PrintWebViewHelper::InitPrintSettings() {
  PrintMsg_PrintPages_Params settings;
  Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
                                                &settings.params));
  bool result = true;
  if (!PrintMsg_Print_Params_IsValid(settings.params))
    result = false;

  if (result &&
      (settings.params.dpi < kMinDpi || settings.params.document_cookie == 0)) {
    NOTREACHED();
    result = false;
  }

  ignore_css_margins_ = false;
  settings.params.fit_to_paper_size = true;
  settings.pages.clear();

  print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings));
  return result;
}
