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

Unified Diff: ui/views/widget/tooltip_manager_win.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 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
« no previous file with comments | « ui/views/widget/tooltip_manager_aura.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/tooltip_manager_win.cc
diff --git a/ui/views/widget/tooltip_manager_win.cc b/ui/views/widget/tooltip_manager_win.cc
index e99f7ab30335ac2b6ba632af9b14c22a845362e4..96886256145ce82ed40def37d21ab66155722e79 100644
--- a/ui/views/widget/tooltip_manager_win.cc
+++ b/ui/views/widget/tooltip_manager_win.cc
@@ -59,9 +59,10 @@ gfx::Font TooltipManager::GetDefaultFont() {
}
// static
-int TooltipManager::GetMaxWidth(int x, int y) {
+int TooltipManager::GetMaxWidth(int x, int y, gfx::NativeView context) {
gfx::Rect monitor_bounds =
- gfx::Screen::GetDisplayNearestPoint(gfx::Point(x, y)).bounds();
+ gfx::Screen::GetScreenFor(context)->GetDisplayNearestPoint(
+ gfx::Point(x, y)).bounds();
// Allow the tooltip to be almost as wide as the screen.
// Otherwise, we would truncate important text, since we're not word-wrapping
// the text onto multiple lines.
@@ -177,7 +178,8 @@ LRESULT TooltipManagerWin::OnNotify(int w_param,
gfx::Point screen_loc = last_mouse_pos_;
View::ConvertPointToScreen(widget_->GetRootView(), &screen_loc);
TrimTooltipToFit(&clipped_text_, &tooltip_width_, &line_count_,
- screen_loc.x(), screen_loc.y());
+ screen_loc.x(), screen_loc.y(),
+ widget_->GetNativeView());
// Adjust the clipped tooltip text for locale direction.
base::i18n::AdjustStringForLocaleDirection(&clipped_text_);
tooltip_info->lpszText = const_cast<WCHAR*>(clipped_text_.c_str());
@@ -342,7 +344,8 @@ void TooltipManagerWin::ShowKeyboardTooltip(View* focused_view) {
int tooltip_width;
int line_count;
TrimTooltipToFit(&tooltip_text, &tooltip_width, &line_count,
- screen_point.x(), screen_point.y());
+ screen_point.x(), screen_point.y(),
+ widget_->GetNativeView());
ReplaceSubstringsAfterOffset(&tooltip_text, 0, L"\n", L"\r\n");
TOOLINFO keyboard_toolinfo;
memset(&keyboard_toolinfo, 0, sizeof(keyboard_toolinfo));
« no previous file with comments | « ui/views/widget/tooltip_manager_aura.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698