Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2925)

Unified Diff: chrome/renderer/printing/print_web_view_helper.cc

Issue 63273002: Rename WebKit namespace to blink (part 4) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/printing/print_web_view_helper.cc
diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc
index f36d40c63f1849eee38cfe49370688183568abe1..70faa91fb8f8297f6df471869676ae32e8c1ce9c 100644
--- a/chrome/renderer/printing/print_web_view_helper.cc
+++ b/chrome/renderer/printing/print_web_view_helper.cc
@@ -68,13 +68,13 @@ const char kPageLoadScriptFormat[] =
const char kPageSetupScriptFormat[] = "setup(%s);";
-void ExecuteScript(WebKit::WebFrame* frame,
+void ExecuteScript(blink::WebFrame* frame,
const char* script_format,
const base::Value& parameters) {
std::string json;
base::JSONWriter::Write(&parameters, &json);
std::string script = base::StringPrintf(script_format, json.c_str());
- frame->executeScript(WebKit::WebString(UTF8ToUTF16(script)));
+ frame->executeScript(blink::WebString(UTF8ToUTF16(script)));
}
int GetDPI(const PrintMsg_Print_Params* print_params) {
@@ -95,13 +95,13 @@ bool PrintMsg_Print_Params_IsValid(const PrintMsg_Print_Params& params) {
}
PrintMsg_Print_Params GetCssPrintParams(
- WebKit::WebFrame* frame,
+ blink::WebFrame* frame,
int page_index,
const PrintMsg_Print_Params& page_params) {
PrintMsg_Print_Params page_css_params = page_params;
int dpi = GetDPI(&page_params);
- WebKit::WebSize page_size_in_pixels(
+ blink::WebSize page_size_in_pixels(
ConvertUnit(page_params.page_size.width(), dpi, kPixelsPerInch),
ConvertUnit(page_params.page_size.height(), dpi, kPixelsPerInch));
int margin_top_in_pixels =
@@ -118,7 +118,7 @@ PrintMsg_Print_Params GetCssPrintParams(
page_params.margin_left,
dpi, kPixelsPerInch);
- WebKit::WebSize original_page_size_in_pixels = page_size_in_pixels;
+ blink::WebSize original_page_size_in_pixels = page_size_in_pixels;
if (frame) {
frame->pageSizeAndMarginsInPixels(page_index,
@@ -245,7 +245,7 @@ void EnsureOrientationMatches(const PrintMsg_Print_Params& css_params,
void ComputeWebKitPrintParamsInDesiredDpi(
const PrintMsg_Print_Params& print_params,
- WebKit::WebPrintParams* webkit_print_params) {
+ blink::WebPrintParams* webkit_print_params) {
int dpi = GetDPI(&print_params);
webkit_print_params->printerDPI = dpi;
webkit_print_params->printScalingOption = print_params.print_scaling_option;
@@ -278,20 +278,20 @@ void ComputeWebKitPrintParamsInDesiredDpi(
print_params.desired_dpi);
}
-WebKit::WebPlugin* GetPlugin(const WebKit::WebFrame* frame) {
+blink::WebPlugin* GetPlugin(const blink::WebFrame* frame) {
return frame->document().isPluginDocument() ?
- frame->document().to<WebKit::WebPluginDocument>().plugin() : NULL;
+ frame->document().to<blink::WebPluginDocument>().plugin() : NULL;
}
-bool PrintingNodeOrPdfFrame(const WebKit::WebFrame* frame,
- const WebKit::WebNode& node) {
+bool PrintingNodeOrPdfFrame(const blink::WebFrame* frame,
+ const blink::WebNode& node) {
if (!node.isNull())
return true;
- WebKit::WebPlugin* plugin = GetPlugin(frame);
+ blink::WebPlugin* plugin = GetPlugin(frame);
return plugin && plugin->supportsPaginatedPrint();
}
-bool PrintingFrameHasPageSizeStyle(WebKit::WebFrame* frame,
+bool PrintingFrameHasPageSizeStyle(blink::WebFrame* frame,
int total_page_count) {
if (!frame)
return false;
@@ -305,8 +305,8 @@ bool PrintingFrameHasPageSizeStyle(WebKit::WebFrame* frame,
return frame_has_custom_page_size_style;
}
-MarginType GetMarginsForPdf(WebKit::WebFrame* frame,
- const WebKit::WebNode& node) {
+MarginType GetMarginsForPdf(blink::WebFrame* frame,
+ const blink::WebNode& node) {
if (frame->isPrintScalingDisabledForPlugin(node))
return NO_MARGINS;
else
@@ -322,7 +322,7 @@ bool FitToPageEnabled(const base::DictionaryValue& job_settings) {
}
PrintMsg_Print_Params CalculatePrintParamsForCss(
- WebKit::WebFrame* frame,
+ blink::WebFrame* frame,
int page_index,
const PrintMsg_Print_Params& page_params,
bool ignore_css_margins,
@@ -376,7 +376,7 @@ bool IsPrintThrottlingDisabled() {
} // namespace
-FrameReference::FrameReference(const WebKit::WebFrame* frame) {
+FrameReference::FrameReference(const blink::WebFrame* frame) {
Reset(frame);
}
@@ -387,7 +387,7 @@ FrameReference::FrameReference() {
FrameReference::~FrameReference() {
}
-void FrameReference::Reset(const WebKit::WebFrame* frame) {
+void FrameReference::Reset(const blink::WebFrame* frame) {
if (frame) {
view_ = frame->view();
frame_name_ = frame->uniqueName();
@@ -397,17 +397,17 @@ void FrameReference::Reset(const WebKit::WebFrame* frame) {
}
}
-WebKit::WebFrame* FrameReference::GetFrame() {
+blink::WebFrame* FrameReference::GetFrame() {
return view_ ? view_->findFrameByName(frame_name_) : NULL;
}
-WebKit::WebView* FrameReference::view() {
+blink::WebView* FrameReference::view() {
return view_;
}
// static - Not anonymous so that platform implementations can use it.
void PrintWebViewHelper::PrintHeaderAndFooter(
- WebKit::WebCanvas* canvas,
+ blink::WebCanvas* canvas,
int page_number,
int total_pages,
float webkit_scale_factor,
@@ -421,16 +421,16 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
SkAutoCanvasRestore auto_restore(canvas, true);
canvas->scale(1 / webkit_scale_factor, 1 / webkit_scale_factor);
- WebKit::WebSize page_size(page_layout.margin_left + page_layout.margin_right +
+ blink::WebSize page_size(page_layout.margin_left + page_layout.margin_right +
page_layout.content_width,
page_layout.margin_top + page_layout.margin_bottom +
page_layout.content_height);
- WebKit::WebView* web_view = WebKit::WebView::create(NULL);
+ blink::WebView* web_view = blink::WebView::create(NULL);
web_view->settings()->setJavaScriptEnabled(true);
web_view->initializeMainFrame(NULL);
- WebKit::WebFrame* frame = web_view->mainFrame();
+ blink::WebFrame* frame = web_view->mainFrame();
base::StringValue html(
ResourceBundle::GetSharedInstance().GetLocalizedString(
@@ -448,7 +448,7 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
ExecuteScript(frame, kPageSetupScriptFormat, *options);
- WebKit::WebPrintParams webkit_params(page_size);
+ blink::WebPrintParams webkit_params(page_size);
webkit_params.printerDPI = GetDPI(&params);
frame->printBegin(webkit_params);
@@ -461,12 +461,12 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
}
// static - Not anonymous so that platform implementations can use it.
-float PrintWebViewHelper::RenderPageContent(WebKit::WebFrame* frame,
+float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame,
int page_number,
const gfx::Rect& canvas_area,
const gfx::Rect& content_area,
double scale_factor,
- WebKit::WebCanvas* canvas) {
+ blink::WebCanvas* canvas) {
SkAutoCanvasRestore auto_restore(canvas, true);
if (content_area != canvas_area) {
canvas->translate((content_area.x() - canvas_area.x()) / scale_factor,
@@ -486,12 +486,12 @@ float PrintWebViewHelper::RenderPageContent(WebKit::WebFrame* frame,
// Class that calls the Begin and End print functions on the frame and changes
// the size of the view temporarily to support full page printing..
-class PrepareFrameAndViewForPrint : public WebKit::WebViewClient,
- public WebKit::WebFrameClient {
+class PrepareFrameAndViewForPrint : public blink::WebViewClient,
+ public blink::WebFrameClient {
public:
PrepareFrameAndViewForPrint(const PrintMsg_Print_Params& params,
- WebKit::WebFrame* frame,
- const WebKit::WebNode& node,
+ blink::WebFrame* frame,
+ const blink::WebNode& node,
bool ignore_css_margins);
virtual ~PrepareFrameAndViewForPrint();
@@ -503,11 +503,11 @@ class PrepareFrameAndViewForPrint : public WebKit::WebViewClient,
// Prepares frame for printing.
void StartPrinting();
- WebKit::WebFrame* frame() {
+ blink::WebFrame* frame() {
return frame_.GetFrame();
}
- const WebKit::WebNode& node() const {
+ const blink::WebNode& node() const {
return node_to_print_;
}
@@ -525,7 +525,7 @@ class PrepareFrameAndViewForPrint : public WebKit::WebViewClient,
}
protected:
- // WebKit::WebViewClient override:
+ // blink::WebViewClient override:
virtual void didStopLoading();
virtual void CallOnReady();
@@ -538,9 +538,9 @@ class PrepareFrameAndViewForPrint : public WebKit::WebViewClient,
base::WeakPtrFactory<PrepareFrameAndViewForPrint> weak_ptr_factory_;
FrameReference frame_;
- WebKit::WebNode node_to_print_;
+ blink::WebNode node_to_print_;
bool owns_web_view_;
- WebKit::WebPrintParams web_print_params_;
+ blink::WebPrintParams web_print_params_;
gfx::Size prev_view_size_;
gfx::Size prev_scroll_offset_;
int expected_pages_count_;
@@ -554,8 +554,8 @@ class PrepareFrameAndViewForPrint : public WebKit::WebViewClient,
PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint(
const PrintMsg_Print_Params& params,
- WebKit::WebFrame* frame,
- const WebKit::WebNode& node,
+ blink::WebFrame* frame,
+ const blink::WebNode& node,
bool ignore_css_margins)
: weak_ptr_factory_(this),
frame_(frame),
@@ -570,7 +570,7 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint(
!PrintingNodeOrPdfFrame(frame, node_to_print_)) {
bool fit_to_page = ignore_css_margins &&
print_params.print_scaling_option ==
- WebKit::WebPrintScalingOptionFitToPrintableArea;
+ blink::WebPrintScalingOptionFitToPrintableArea;
ComputeWebKitPrintParamsInDesiredDpi(params, &web_print_params_);
frame->printBegin(web_print_params_, node_to_print_);
print_params = CalculatePrintParamsForCss(frame, 0, print_params,
@@ -598,9 +598,9 @@ void PrepareFrameAndViewForPrint::ResizeForPrinting() {
if (!frame())
return;
- WebKit::WebView* web_view = frame_.view();
+ blink::WebView* web_view = frame_.view();
// Backup size and offset.
- if (WebKit::WebFrame* web_frame = web_view->mainFrame())
+ if (blink::WebFrame* web_frame = web_view->mainFrame())
prev_scroll_offset_ = web_frame->scrollOffset();
prev_view_size_ = web_view->size();
@@ -610,7 +610,7 @@ void PrepareFrameAndViewForPrint::ResizeForPrinting() {
void PrepareFrameAndViewForPrint::StartPrinting() {
ResizeForPrinting();
- WebKit::WebView* web_view = frame_.view();
+ blink::WebView* web_view = frame_.view();
web_view->settings()->setShouldPrintBackgrounds(should_print_backgrounds_);
expected_pages_count_ =
frame()->printBegin(web_print_params_, node_to_print_);
@@ -641,7 +641,7 @@ void PrepareFrameAndViewForPrint::CopySelection(
prefs.javascript_enabled = false;
prefs.java_enabled = false;
- WebKit::WebView* web_view = WebKit::WebView::create(this);
+ blink::WebView* web_view = blink::WebView::create(this);
owns_web_view_ = true;
content::ApplyWebPreferences(prefs, web_view);
web_view->initializeMainFrame(this);
@@ -650,7 +650,7 @@ void PrepareFrameAndViewForPrint::CopySelection(
// When loading is done this will call didStopLoading() and that will do the
// actual printing.
- frame()->loadRequest(WebKit::WebURLRequest(GURL(url_str)));
+ frame()->loadRequest(blink::WebURLRequest(GURL(url_str)));
}
void PrepareFrameAndViewForPrint::didStopLoading() {
@@ -675,17 +675,17 @@ gfx::Size PrepareFrameAndViewForPrint::GetPrintCanvasSize() const {
void PrepareFrameAndViewForPrint::RestoreSize() {
if (frame()) {
- WebKit::WebView* web_view = frame_.GetFrame()->view();
+ blink::WebView* web_view = frame_.GetFrame()->view();
web_view->resize(prev_view_size_);
- if (WebKit::WebFrame* web_frame = web_view->mainFrame())
+ if (blink::WebFrame* web_frame = web_view->mainFrame())
web_frame->setScrollOffset(prev_scroll_offset_);
}
}
void PrepareFrameAndViewForPrint::FinishPrinting() {
- WebKit::WebFrame* frame = frame_.GetFrame();
+ blink::WebFrame* frame = frame_.GetFrame();
if (frame) {
- WebKit::WebView* web_view = frame->view();
+ blink::WebView* web_view = frame->view();
if (is_printing_started_) {
is_printing_started_ = false;
frame->printEnd();
@@ -725,7 +725,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view)
PrintWebViewHelper::~PrintWebViewHelper() {}
bool PrintWebViewHelper::IsScriptInitiatedPrintAllowed(
- WebKit::WebFrame* frame, bool user_initiated) {
+ blink::WebFrame* frame, bool user_initiated) {
#if defined(OS_ANDROID)
return false;
#endif // defined(OS_ANDROID)
@@ -752,7 +752,7 @@ void PrintWebViewHelper::DidStopLoading() {
}
// Prints |frame| which called window.print().
-void PrintWebViewHelper::PrintPage(WebKit::WebFrame* frame,
+void PrintWebViewHelper::PrintPage(blink::WebFrame* frame,
bool user_initiated) {
DCHECK(frame);
@@ -770,7 +770,7 @@ void PrintWebViewHelper::PrintPage(WebKit::WebFrame* frame,
print_preview_context_.InitWithFrame(frame);
RequestPrintPreview(PRINT_PREVIEW_SCRIPTED);
} else {
- Print(frame, WebKit::WebNode());
+ Print(frame, blink::WebNode());
}
}
@@ -803,14 +803,14 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
if (!render_view()->GetWebView())
return;
- WebKit::WebFrame* main_frame = render_view()->GetWebView()->mainFrame();
+ blink::WebFrame* main_frame = render_view()->GetWebView()->mainFrame();
if (!main_frame)
return;
- WebKit::WebDocument document = main_frame->document();
+ blink::WebDocument document = main_frame->document();
// <object> with id="pdf-viewer" is created in
// chrome/browser/resources/print_preview/print_preview.js
- WebKit::WebElement pdf_element = document.getElementById("pdf-viewer");
+ blink::WebElement pdf_element = document.getElementById("pdf-viewer");
if (pdf_element.isNull()) {
NOTREACHED();
return;
@@ -820,7 +820,7 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
// on return.
base::AutoReset<bool> set_printing_flag(&print_for_preview_, true);
- WebKit::WebFrame* pdf_frame = pdf_element.document().frame();
+ blink::WebFrame* pdf_frame = pdf_element.document().frame();
if (!UpdatePrintSettings(pdf_frame, pdf_element, job_settings)) {
LOG(ERROR) << "UpdatePrintSettings failed";
DidFinishPrinting(FAIL_PRINT);
@@ -846,28 +846,28 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
}
}
-bool PrintWebViewHelper::GetPrintFrame(WebKit::WebFrame** frame) {
+bool PrintWebViewHelper::GetPrintFrame(blink::WebFrame** frame) {
DCHECK(frame);
- WebKit::WebView* webView = render_view()->GetWebView();
+ blink::WebView* webView = render_view()->GetWebView();
DCHECK(webView);
if (!webView)
return false;
// If the user has selected text in the currently focused frame we print
// only that frame (this makes print selection work for multiple frames).
- WebKit::WebFrame* focusedFrame = webView->focusedFrame();
+ blink::WebFrame* focusedFrame = webView->focusedFrame();
*frame = focusedFrame->hasSelection() ? focusedFrame : webView->mainFrame();
return true;
}
void PrintWebViewHelper::OnPrintPages() {
- WebKit::WebFrame* frame;
+ blink::WebFrame* frame;
if (GetPrintFrame(&frame))
- Print(frame, WebKit::WebNode());
+ Print(frame, blink::WebNode());
}
void PrintWebViewHelper::OnPrintForSystemDialog() {
- WebKit::WebFrame* frame = print_preview_context_.source_frame();
+ blink::WebFrame* frame = print_preview_context_.source_frame();
if (!frame) {
NOTREACHED();
return;
@@ -909,26 +909,26 @@ bool PrintWebViewHelper::IsPrintToPdfRequested(
return print_to_pdf;
}
-WebKit::WebPrintScalingOption PrintWebViewHelper::GetPrintScalingOption(
+blink::WebPrintScalingOption PrintWebViewHelper::GetPrintScalingOption(
bool source_is_html, const base::DictionaryValue& job_settings,
const PrintMsg_Print_Params& params) {
DCHECK(!print_for_preview_);
if (params.print_to_pdf)
- return WebKit::WebPrintScalingOptionSourceSize;
+ return blink::WebPrintScalingOptionSourceSize;
if (!source_is_html) {
if (!FitToPageEnabled(job_settings))
- return WebKit::WebPrintScalingOptionNone;
+ return blink::WebPrintScalingOptionNone;
bool no_plugin_scaling =
print_preview_context_.source_frame()->isPrintScalingDisabledForPlugin(
print_preview_context_.source_node());
if (params.is_first_request && no_plugin_scaling)
- return WebKit::WebPrintScalingOptionNone;
+ return blink::WebPrintScalingOptionNone;
}
- return WebKit::WebPrintScalingOptionFitToPrintableArea;
+ return blink::WebPrintScalingOptionFitToPrintableArea;
}
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
@@ -1134,7 +1134,7 @@ void PrintWebViewHelper::OnPrintNodeUnderContextMenu() {
void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
DCHECK(is_preview_enabled_);
- WebKit::WebFrame* frame = NULL;
+ blink::WebFrame* frame = NULL;
GetPrintFrame(&frame);
DCHECK(frame);
print_preview_context_.InitWithFrame(frame);
@@ -1149,7 +1149,7 @@ bool PrintWebViewHelper::IsPrintingEnabled() {
return result;
}
-void PrintWebViewHelper::PrintNode(const WebKit::WebNode& node) {
+void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
if (node.isNull() || !node.document().frame()) {
// This can occur when the context menu refers to an invalid WebNode.
// See http://crbug.com/100890#c17 for a repro case.
@@ -1171,15 +1171,15 @@ void PrintWebViewHelper::PrintNode(const WebKit::WebNode& node) {
print_preview_context_.InitWithNode(node);
RequestPrintPreview(PRINT_PREVIEW_USER_INITIATED_CONTEXT_NODE);
} else {
- WebKit::WebNode duplicate_node(node);
+ blink::WebNode duplicate_node(node);
Print(duplicate_node.document().frame(), duplicate_node);
}
print_node_in_progress_ = false;
}
-void PrintWebViewHelper::Print(WebKit::WebFrame* frame,
- const WebKit::WebNode& node) {
+void PrintWebViewHelper::Print(blink::WebFrame* frame,
+ const blink::WebNode& node) {
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -1298,7 +1298,7 @@ void PrintWebViewHelper::FinishFramePrinting() {
}
#if defined(OS_MACOSX) || defined(OS_WIN)
-bool PrintWebViewHelper::PrintPagesNative(WebKit::WebFrame* frame,
+bool PrintWebViewHelper::PrintPagesNative(blink::WebFrame* frame,
int page_count,
const gfx::Size& canvas_size) {
const PrintMsg_PrintPages_Params& params = *print_pages_params_;
@@ -1326,7 +1326,7 @@ bool PrintWebViewHelper::PrintPagesNative(WebKit::WebFrame* frame,
// static - Not anonymous so that platform implementations can use it.
void PrintWebViewHelper::ComputePageLayoutInPointsForCss(
- WebKit::WebFrame* frame,
+ blink::WebFrame* frame,
int page_index,
const PrintMsg_Print_Params& page_params,
bool ignore_css_margins,
@@ -1335,7 +1335,7 @@ void PrintWebViewHelper::ComputePageLayoutInPointsForCss(
PrintMsg_Print_Params params = CalculatePrintParamsForCss(
frame, page_index, page_params, ignore_css_margins,
page_params.print_scaling_option ==
- WebKit::WebPrintScalingOptionFitToPrintableArea,
+ blink::WebPrintScalingOptionFitToPrintableArea,
scale_factor);
CalculatePageLayoutFromPrintParams(params, page_layout_in_points);
}
@@ -1363,18 +1363,18 @@ bool PrintWebViewHelper::InitPrintSettings(bool fit_to_paper_size) {
settings.pages.clear();
settings.params.print_scaling_option =
- WebKit::WebPrintScalingOptionSourceSize;
+ blink::WebPrintScalingOptionSourceSize;
if (fit_to_paper_size) {
settings.params.print_scaling_option =
- WebKit::WebPrintScalingOptionFitToPrintableArea;
+ blink::WebPrintScalingOptionFitToPrintableArea;
}
print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings));
return result;
}
-bool PrintWebViewHelper::CalculateNumberOfPages(WebKit::WebFrame* frame,
- const WebKit::WebNode& node,
+bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebFrame* frame,
+ const blink::WebNode& node,
int* number_of_pages) {
DCHECK(frame);
bool fit_to_paper_size = !(PrintingNodeOrPdfFrame(frame, node));
@@ -1397,8 +1397,8 @@ bool PrintWebViewHelper::CalculateNumberOfPages(WebKit::WebFrame* frame,
}
bool PrintWebViewHelper::UpdatePrintSettings(
- WebKit::WebFrame* frame,
- const WebKit::WebNode& node,
+ blink::WebFrame* frame,
+ const blink::WebNode& node,
const base::DictionaryValue& passed_job_settings) {
DCHECK(is_preview_enabled_);
const base::DictionaryValue* job_settings = &passed_job_settings;
@@ -1439,7 +1439,7 @@ bool PrintWebViewHelper::UpdatePrintSettings(
print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS);
} else {
// PrintForPrintPreview
- WebKit::WebFrame* print_frame = NULL;
+ blink::WebFrame* print_frame = NULL;
// This may not be the right frame, but the alert will be modal,
// therefore it works well enough.
GetPrintFrame(&print_frame);
@@ -1499,8 +1499,8 @@ bool PrintWebViewHelper::UpdatePrintSettings(
return true;
}
-bool PrintWebViewHelper::GetPrintSettingsFromUser(WebKit::WebFrame* frame,
- const WebKit::WebNode& node,
+bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebFrame* frame,
+ const blink::WebNode& node,
int expected_pages_count) {
PrintHostMsg_ScriptedPrint_Params params;
PrintMsg_PrintPages_Params print_settings;
@@ -1517,7 +1517,7 @@ bool PrintWebViewHelper::GetPrintSettingsFromUser(WebKit::WebFrame* frame,
// PrintHostMsg_ScriptedPrint will reset print_scaling_option, so we save the
// value before and restore it afterwards.
- WebKit::WebPrintScalingOption scaling_option =
+ blink::WebPrintScalingOption scaling_option =
print_pages_params_->params.print_scaling_option;
print_pages_params_.reset();
@@ -1531,8 +1531,8 @@ bool PrintWebViewHelper::GetPrintSettingsFromUser(WebKit::WebFrame* frame,
return (print_settings.params.dpi && print_settings.params.document_cookie);
}
-bool PrintWebViewHelper::RenderPagesForPrint(WebKit::WebFrame* frame,
- const WebKit::WebNode& node) {
+bool PrintWebViewHelper::RenderPagesForPrint(blink::WebFrame* frame,
+ const blink::WebNode& node) {
if (!frame || prep_frame_view_)
return false;
const PrintMsg_PrintPages_Params& params = *print_pages_params_;
@@ -1572,7 +1572,7 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
#endif // defined(OS_POSIX)
bool PrintWebViewHelper::IsScriptInitiatedPrintTooFrequent(
- WebKit::WebFrame* frame) {
+ blink::WebFrame* frame) {
const int kMinSecondsToIgnoreJavascriptInitiatedPrint = 2;
const int kMaxSecondsToIgnoreJavascriptInitiatedPrint = 32;
bool too_frequent = false;
@@ -1600,11 +1600,11 @@ bool PrintWebViewHelper::IsScriptInitiatedPrintTooFrequent(
if (!too_frequent)
return false;
- WebKit::WebString message(
- WebKit::WebString::fromUTF8("Ignoring too frequent calls to print()."));
+ blink::WebString message(
+ blink::WebString::fromUTF8("Ignoring too frequent calls to print()."));
frame->addMessageToConsole(
- WebKit::WebConsoleMessage(
- WebKit::WebConsoleMessage::LevelWarning, message));
+ blink::WebConsoleMessage(
+ blink::WebConsoleMessage::LevelWarning, message));
return true;
}
@@ -1742,7 +1742,7 @@ PrintWebViewHelper::PrintPreviewContext::~PrintPreviewContext() {
}
void PrintWebViewHelper::PrintPreviewContext::InitWithFrame(
- WebKit::WebFrame* web_frame) {
+ blink::WebFrame* web_frame) {
DCHECK(web_frame);
DCHECK(!IsRendering());
state_ = INITIALIZED;
@@ -1751,7 +1751,7 @@ void PrintWebViewHelper::PrintPreviewContext::InitWithFrame(
}
void PrintWebViewHelper::PrintPreviewContext::InitWithNode(
- const WebKit::WebNode& web_node) {
+ const blink::WebNode& web_node) {
DCHECK(!web_node.isNull());
DCHECK(web_node.document().frame());
DCHECK(!IsRendering());
@@ -1918,23 +1918,23 @@ void PrintWebViewHelper::PrintPreviewContext::set_error(
error_ = error;
}
-WebKit::WebFrame* PrintWebViewHelper::PrintPreviewContext::source_frame() {
+blink::WebFrame* PrintWebViewHelper::PrintPreviewContext::source_frame() {
DCHECK(state_ != UNINITIALIZED);
return source_frame_.GetFrame();
}
-const WebKit::WebNode&
+const blink::WebNode&
PrintWebViewHelper::PrintPreviewContext::source_node() const {
DCHECK(state_ != UNINITIALIZED);
return source_node_;
}
-WebKit::WebFrame* PrintWebViewHelper::PrintPreviewContext::prepared_frame() {
+blink::WebFrame* PrintWebViewHelper::PrintPreviewContext::prepared_frame() {
DCHECK(state_ != UNINITIALIZED);
return prep_frame_view_->frame();
}
-const WebKit::WebNode&
+const blink::WebNode&
PrintWebViewHelper::PrintPreviewContext::prepared_node() const {
DCHECK(state_ != UNINITIALIZED);
return prep_frame_view_->node();
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper.h ('k') | chrome/renderer/printing/print_web_view_helper_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698