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

Side by Side Diff: webkit/glue/chrome_client_impl.cc

Issue 159222: Checking tooltip against empty before adding Unicode marks (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 8
9 MSVC_PUSH_WARNING_LEVEL(0); 9 MSVC_PUSH_WARNING_LEVEL(0);
10 #include "AccessibilityObject.h" 10 #include "AccessibilityObject.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 delegate->UpdateTargetURL(webview_, GURL()); 506 delegate->UpdateTargetURL(webview_, GURL());
507 } 507 }
508 } 508 }
509 } 509 }
510 510
511 void ChromeClientImpl::setToolTip(const WebCore::String& tooltip_text, 511 void ChromeClientImpl::setToolTip(const WebCore::String& tooltip_text,
512 WebCore::TextDirection dir) { 512 WebCore::TextDirection dir) {
513 if (webview_->delegate()) { 513 if (webview_->delegate()) {
514 std::wstring tooltip_text_as_wstring = 514 std::wstring tooltip_text_as_wstring =
515 webkit_glue::StringToStdWString(tooltip_text); 515 webkit_glue::StringToStdWString(tooltip_text);
516 if (dir == WebCore::LTR) { 516 if (!tooltip_text_as_wstring.empty()) {
517 // Force the tooltip to have LTR directionality. 517 if (dir == WebCore::LTR) {
518 tooltip_text_as_wstring.insert(0, 1, WebCore::leftToRightEmbed); 518 // Force the tooltip to have LTR directionality.
519 tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); 519 tooltip_text_as_wstring.insert(0, 1, WebCore::leftToRightEmbed);
520 } else { 520 tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting);
521 // Force the tooltip to have RTL directionality. 521 } else {
522 tooltip_text_as_wstring.insert(0, 1, WebCore::rightToLeftEmbed); 522 // Force the tooltip to have RTL directionality.
523 tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); 523 tooltip_text_as_wstring.insert(0, 1, WebCore::rightToLeftEmbed);
524 tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting);
525 }
524 } 526 }
525 webview_->delegate()->SetTooltipText(webview_, tooltip_text_as_wstring); 527 webview_->delegate()->SetTooltipText(webview_, tooltip_text_as_wstring);
526 } 528 }
527 } 529 }
528 530
529 void ChromeClientImpl::print(WebCore::Frame* frame) { 531 void ChromeClientImpl::print(WebCore::Frame* frame) {
530 WebViewDelegate* delegate = webview_->delegate(); 532 WebViewDelegate* delegate = webview_->delegate();
531 if (delegate) { 533 if (delegate) {
532 delegate->ScriptedPrint(WebFrameImpl::FromFrame(frame)); 534 delegate->ScriptedPrint(WebFrameImpl::FromFrame(frame));
533 } 535 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 break; 629 break;
628 default: 630 default:
629 NOTREACHED(); 631 NOTREACHED();
630 } 632 }
631 } 633 }
632 634
633 info->itemHeight = popup_container->menuItemHeight(); 635 info->itemHeight = popup_container->menuItemHeight();
634 info->selectedIndex = popup_container->selectedIndex(); 636 info->selectedIndex = popup_container->selectedIndex();
635 info->items.swap(output_items); 637 info->items.swap(output_items);
636 } 638 }
OLDNEW
« 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