OLD | NEW |
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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 delegate->UpdateTargetURL(webview_, GURL()); | 510 delegate->UpdateTargetURL(webview_, GURL()); |
511 } | 511 } |
512 } | 512 } |
513 } | 513 } |
514 | 514 |
515 void ChromeClientImpl::setToolTip(const WebCore::String& tooltip_text, | 515 void ChromeClientImpl::setToolTip(const WebCore::String& tooltip_text, |
516 WebCore::TextDirection dir) { | 516 WebCore::TextDirection dir) { |
517 if (webview_->delegate()) { | 517 if (webview_->delegate()) { |
518 std::wstring tooltip_text_as_wstring = | 518 std::wstring tooltip_text_as_wstring = |
519 webkit_glue::StringToStdWString(tooltip_text); | 519 webkit_glue::StringToStdWString(tooltip_text); |
520 if (dir == WebCore::LTR) { | 520 if (!tooltip_text_as_wstring.empty()) { |
521 // Force the tooltip to have LTR directionality. | 521 if (dir == WebCore::LTR) { |
522 tooltip_text_as_wstring.insert(0, 1, WebCore::leftToRightEmbed); | 522 // Force the tooltip to have LTR directionality. |
523 tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); | 523 tooltip_text_as_wstring.insert(0, 1, WebCore::leftToRightEmbed); |
524 } else { | 524 tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); |
525 // Force the tooltip to have RTL directionality. | 525 } else { |
526 tooltip_text_as_wstring.insert(0, 1, WebCore::rightToLeftEmbed); | 526 // Force the tooltip to have RTL directionality. |
527 tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); | 527 tooltip_text_as_wstring.insert(0, 1, WebCore::rightToLeftEmbed); |
| 528 tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); |
| 529 } |
528 } | 530 } |
529 webview_->delegate()->SetTooltipText(webview_, tooltip_text_as_wstring); | 531 webview_->delegate()->SetTooltipText(webview_, tooltip_text_as_wstring); |
530 } | 532 } |
531 } | 533 } |
532 | 534 |
533 void ChromeClientImpl::print(WebCore::Frame* frame) { | 535 void ChromeClientImpl::print(WebCore::Frame* frame) { |
534 WebViewDelegate* delegate = webview_->delegate(); | 536 WebViewDelegate* delegate = webview_->delegate(); |
535 if (delegate) { | 537 if (delegate) { |
536 delegate->ScriptedPrint(WebFrameImpl::FromFrame(frame)); | 538 delegate->ScriptedPrint(WebFrameImpl::FromFrame(frame)); |
537 } | 539 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 break; | 633 break; |
632 default: | 634 default: |
633 NOTREACHED(); | 635 NOTREACHED(); |
634 } | 636 } |
635 } | 637 } |
636 | 638 |
637 info->itemHeight = popup_container->menuItemHeight(); | 639 info->itemHeight = popup_container->menuItemHeight(); |
638 info->selectedIndex = popup_container->selectedIndex(); | 640 info->selectedIndex = popup_container->selectedIndex(); |
639 info->items.swap(output_items); | 641 info->items.swap(output_items); |
640 } | 642 } |
OLD | NEW |