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

Unified Diff: Source/core/page/ChromeClient.cpp

Issue 1152413003: General code cleanup of ChromeClient-related classes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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
Index: Source/core/page/ChromeClient.cpp
diff --git a/Source/core/page/ChromeClient.cpp b/Source/core/page/ChromeClient.cpp
index 58897e9d68cc4d04587686a224bee5db5e8bd9bf..057675a6f6a483e781f4eeeb0ebecd1ecf6e5ea3 100644
--- a/Source/core/page/ChromeClient.cpp
+++ b/Source/core/page/ChromeClient.cpp
@@ -43,7 +43,8 @@ void ChromeClient::setWindowRectWithAdjustment(const IntRect& pendingRect)
IntRect window = pendingRect;
IntSize minimumSize = minimumWindowSize();
- // Let size 0 pass through, since that indicates default size, not minimum size.
+ // Let size 0 pass through, since that indicates default size, not minimum
+ // size.
if (window.width())
window.setWidth(std::min(std::max(minimumSize.width(), window.width()), screen.width()));
if (window.height())
@@ -140,10 +141,9 @@ bool ChromeClient::runJavaScriptPrompt(LocalFrame* frame, const String& prompt,
void ChromeClient::mouseDidMoveOverElement(const HitTestResult& result)
{
- if (result.innerNode()) {
- if (result.innerNode()->document().isDNSPrefetchEnabled())
- prefetchDNS(result.absoluteLinkURL().host());
- }
+ if (result.innerNode() && result.innerNode()->document().isDNSPrefetchEnabled())
+ prefetchDNS(result.absoluteLinkURL().host());
+
showMouseOverURL(result);
setToolTip(result);
@@ -151,15 +151,17 @@ void ChromeClient::mouseDidMoveOverElement(const HitTestResult& result)
void ChromeClient::setToolTip(const HitTestResult& result)
{
- // First priority is a potential toolTip representing a spelling or grammar error
+ // First priority is a potential toolTip representing a spelling or grammar
+ // error.
TextDirection toolTipDirection;
String toolTip = result.spellingToolTip(toolTipDirection);
- // Next we'll consider a tooltip for element with "title" attribute
+ // Next we'll consider a tooltip for element with "title" attribute.
if (toolTip.isEmpty())
toolTip = result.title(toolTipDirection);
- // Lastly, for <input type="file"> that allow multiple files, we'll consider a tooltip for the selected filenames
+ // Lastly, for <input type="file"> that allow multiple files, we'll consider
+ // a tooltip for the selected filenames.
if (toolTip.isEmpty()) {
if (Node* node = result.innerNode()) {
if (isHTMLInputElement(*node)) {
@@ -182,7 +184,8 @@ void ChromeClient::setToolTip(const HitTestResult& result)
void ChromeClient::print(LocalFrame* frame)
{
// Defer loads in case the client method runs a new event loop that would
- // otherwise cause the load to continue while we're in the middle of executing JavaScript.
+ // otherwise cause the load to continue while we're in the middle of
+ // executing JavaScript.
ScopedPageLoadDeferrer deferrer;
printInternal(frame);

Powered by Google App Engine
This is Rietveld 408576698