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

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

Issue 17568014: Remove redundant calls to obtain WebView in PrintWebViewHelper::GetPrintFrame() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3966b363900ff52235a906eb148c96b4f41ac3af..5ea73401e4964bb94e9bcf39356b88592eb108eb 100644
--- a/chrome/renderer/printing/print_web_view_helper.cc
+++ b/chrome/renderer/printing/print_web_view_helper.cc
@@ -858,15 +858,15 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
bool PrintWebViewHelper::GetPrintFrame(WebKit::WebFrame** frame) {
DCHECK(frame);
- DCHECK(render_view()->GetWebView());
- if (!render_view()->GetWebView())
+ WebKit::WebView* webView = render_view()->GetWebView();
+ DCHECK(webView);
+ if (!webView)
vivekg_samsung 2013/06/24 09:29:14 Having both "DCHECK(webView)" and "if (!webView) r
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).
- *frame = render_view()->GetWebView()->focusedFrame()->hasSelection() ?
- render_view()->GetWebView()->focusedFrame() :
- render_view()->GetWebView()->mainFrame();
+ WebKit::WebFrame* focusedFrame = webView->focusedFrame();
+ *frame = focusedFrame->hasSelection() ? focusedFrame : webView->mainFrame();
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698