| 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 <limits> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "chrome/common/gfx/chrome_font.h" | 7 #include "chrome/common/gfx/chrome_font.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/common/l10n_util.h" | 10 #include "chrome/common/l10n_util.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 gfx::Point view_loc(last_mouse_x_, last_mouse_y_); | 167 gfx::Point view_loc(last_mouse_x_, last_mouse_y_); |
| 168 View::ConvertPointToView(widget_->GetRootView(), | 168 View::ConvertPointToView(widget_->GetRootView(), |
| 169 last_tooltip_view_, &view_loc); | 169 last_tooltip_view_, &view_loc); |
| 170 if (last_tooltip_view_->GetTooltipText(view_loc.x(), view_loc.y(), | 170 if (last_tooltip_view_->GetTooltipText(view_loc.x(), view_loc.y(), |
| 171 &tooltip_text_) && | 171 &tooltip_text_) && |
| 172 !tooltip_text_.empty()) { | 172 !tooltip_text_.empty()) { |
| 173 // View has a valid tip, copy it into TOOLTIPINFO. | 173 // View has a valid tip, copy it into TOOLTIPINFO. |
| 174 clipped_text_ = tooltip_text_; | 174 clipped_text_ = tooltip_text_; |
| 175 TrimTooltipToFit(&clipped_text_, &tooltip_width_, &line_count_, | 175 TrimTooltipToFit(&clipped_text_, &tooltip_width_, &line_count_, |
| 176 last_mouse_x_, last_mouse_y_, tooltip_hwnd_); | 176 last_mouse_x_, last_mouse_y_, tooltip_hwnd_); |
| 177 // Adjust the clipped tooltip text for locale direction. |
| 178 l10n_util::AdjustStringForLocaleDirection(clipped_text_, |
| 179 &clipped_text_); |
| 177 tooltip_info->lpszText = const_cast<WCHAR*>(clipped_text_.c_str()); | 180 tooltip_info->lpszText = const_cast<WCHAR*>(clipped_text_.c_str()); |
| 178 } else { | 181 } else { |
| 179 tooltip_text_.clear(); | 182 tooltip_text_.clear(); |
| 180 } | 183 } |
| 181 } | 184 } |
| 182 *handled = true; | 185 *handled = true; |
| 183 return 0; | 186 return 0; |
| 184 } | 187 } |
| 185 case TTN_POP: | 188 case TTN_POP: |
| 186 tooltip_showing_ = false; | 189 tooltip_showing_ = false; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 keyboard_tooltip_hwnd_ = NULL; | 434 keyboard_tooltip_hwnd_ = NULL; |
| 432 } | 435 } |
| 433 } | 436 } |
| 434 | 437 |
| 435 void TooltipManager::DestroyKeyboardTooltipWindow(HWND window_to_destroy) { | 438 void TooltipManager::DestroyKeyboardTooltipWindow(HWND window_to_destroy) { |
| 436 if (keyboard_tooltip_hwnd_ == window_to_destroy) | 439 if (keyboard_tooltip_hwnd_ == window_to_destroy) |
| 437 HideKeyboardTooltip(); | 440 HideKeyboardTooltip(); |
| 438 } | 441 } |
| 439 | 442 |
| 440 } // namespace views | 443 } // namespace views |
| OLD | NEW |