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

Unified Diff: webkit/glue/chrome_client_impl.cc

Issue 147240: Review Request: display tooltip in the directionality of its element's (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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
« webkit/glue/chrome_client_impl.h ('K') | « webkit/glue/chrome_client_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/chrome_client_impl.cc
===================================================================
--- webkit/glue/chrome_client_impl.cc (revision 19223)
+++ webkit/glue/chrome_client_impl.cc (working copy)
@@ -9,6 +9,7 @@
MSVC_PUSH_WARNING_LEVEL(0);
#include "AccessibilityObject.h"
#include "AXObjectCache.h"
+#include "CharacterNames.h"
#include "Console.h"
#include "Cursor.h"
#include "Document.h"
@@ -504,10 +505,20 @@
}
}
-void ChromeClientImpl::setToolTip(const WebCore::String& tooltip_text) {
+void ChromeClientImpl::setToolTip(const WebCore::String& tooltip_text,
+ WebCore::TextDirection dir) {
if (webview_->delegate()) {
std::wstring tooltip_text_as_wstring =
webkit_glue::StringToStdWString(tooltip_text);
+ if (dir == WebCore::LTR) {
+ // Force the tooltip to have LTR directionality.
+ tooltip_text_as_wstring.insert(0, 1, WebCore::leftToRightEmbed);
+ tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting);
idana 2009/07/20 20:50:10 Are you sure that it is safe to insert these chara
jungshik at Google 2009/07/20 21:18:33 It's whether or not 'install files for complex scr
xji 2009/07/20 23:51:04 I unchecked "install files for complex script and
+ } else {
+ // Force the tooltip to have RTL directionality.
+ tooltip_text_as_wstring.insert(0, 1, WebCore::rightToLeftEmbed);
+ tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting);
+ }
webview_->delegate()->SetTooltipText(webview_, tooltip_text_as_wstring);
}
}
« webkit/glue/chrome_client_impl.h ('K') | « webkit/glue/chrome_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698