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

Side by Side Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 1454363002: Close tooltip for |title| attribute on any keyboard event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix DOCTYPE Created 5 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // Converts a AXObjectCache::AXNotification to a WebAXEvent 115 // Converts a AXObjectCache::AXNotification to a WebAXEvent
116 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) 116 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification)
117 { 117 {
118 // These enums have the same values; enforced in AssertMatchingEnums.cpp. 118 // These enums have the same values; enforced in AssertMatchingEnums.cpp.
119 return static_cast<WebAXEvent>(notification); 119 return static_cast<WebAXEvent>(notification);
120 } 120 }
121 121
122 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) 122 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
123 : m_webView(webView) 123 : m_webView(webView)
124 , m_cursorOverridden(false) 124 , m_cursorOverridden(false)
125 , m_didRequestNonEmptyToolTip(false)
125 { 126 {
126 } 127 }
127 128
128 ChromeClientImpl::~ChromeClientImpl() 129 ChromeClientImpl::~ChromeClientImpl()
129 { 130 {
130 } 131 }
131 132
132 PassOwnPtrWillBeRawPtr<ChromeClientImpl> ChromeClientImpl::create(WebViewImpl* w ebView) 133 PassOwnPtrWillBeRawPtr<ChromeClientImpl> ChromeClientImpl::create(WebViewImpl* w ebView)
133 { 134 {
134 return adoptPtrWillBeNoop(new ChromeClientImpl(webView)); 135 return adoptPtrWillBeNoop(new ChromeClientImpl(webView));
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 url = plugin->plugin()->linkAtPosition(result.roundedPointInInne rNodeFrame()); 570 url = plugin->plugin()->linkAtPosition(result.roundedPointInInne rNodeFrame());
570 } 571 }
571 } 572 }
572 } 573 }
573 574
574 m_webView->client()->setMouseOverURL(url); 575 m_webView->client()->setMouseOverURL(url);
575 } 576 }
576 577
577 void ChromeClientImpl::setToolTip(const String& tooltipText, TextDirection dir) 578 void ChromeClientImpl::setToolTip(const String& tooltipText, TextDirection dir)
578 { 579 {
579 if (m_webView->client()) 580 if (!m_webView->client())
581 return;
582 if (!tooltipText.isEmpty()) {
580 m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir) ); 583 m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir) );
584 m_didRequestNonEmptyToolTip = true;
585 } else if (m_didRequestNonEmptyToolTip) {
586 // WebViewClient::setToolTipText will send an IPC message. We'd like to
587 // reduce the number of setToolTipText calls.
588 m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir) );
589 m_didRequestNonEmptyToolTip = false;
590 }
581 } 591 }
582 592
583 void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportDescrip tion& description) const 593 void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportDescrip tion& description) const
584 { 594 {
585 m_webView->updatePageDefinedViewportConstraints(description); 595 m_webView->updatePageDefinedViewportConstraints(description);
586 } 596 }
587 597
588 void ChromeClientImpl::printDelegate(LocalFrame* frame) 598 void ChromeClientImpl::printDelegate(LocalFrame* frame)
589 { 599 {
590 if (m_webView->client()) 600 if (m_webView->client())
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 if (m_webView->pageImportanceSignals()) 1019 if (m_webView->pageImportanceSignals())
1010 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript(); 1020 m_webView->pageImportanceSignals()->setIssuedNonGetFetchFromScript();
1011 } 1021 }
1012 1022
1013 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler() 1023 PassOwnPtr<WebFrameScheduler> ChromeClientImpl::createFrameScheduler()
1014 { 1024 {
1015 return m_webView->scheduler()->createFrameScheduler().release(); 1025 return m_webView->scheduler()->createFrameScheduler().release();
1016 } 1026 }
1017 1027
1018 } // namespace blink 1028 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698