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

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

Issue 12257016: (Not ready for review!) Toolbar and views high dpi support. Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cleaned up more useless diffs. Created 7 years, 10 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/view.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/aero_tooltip_manager.cc
diff --git a/ui/views/widget/aero_tooltip_manager.cc b/ui/views/widget/aero_tooltip_manager.cc
index 7976bc458f7131398f43becc9722a1f33aa206f0..97b700e6c95ca37bd3f435c1bbf7451d8f46d29c 100644
--- a/ui/views/widget/aero_tooltip_manager.cc
+++ b/ui/views/widget/aero_tooltip_manager.cc
@@ -12,6 +12,7 @@
#include "base/message_loop.h"
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/base/win/hwnd_util.h"
+#include "ui/base/win/dpi.h"
#include "ui/gfx/point.h"
namespace views {
@@ -19,6 +20,12 @@ namespace views {
///////////////////////////////////////////////////////////////////////////////
// AeroTooltipManager, public:
+void ScalePos(gfx::Point& pos) {
+ float scale = ui::GetDPIScale();
+ pos.set_x(pos.x() / scale);
+ pos.set_y(pos.y() / scale);
+}
+
AeroTooltipManager::AeroTooltipManager(Widget* widget)
: TooltipManagerWin(widget),
initial_delay_(0) {
@@ -47,6 +54,7 @@ void AeroTooltipManager::OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param) {
::MapWindowPoints(HWND_DESKTOP, GetParent(), &temp, 1);
mouse_pos.SetPoint(temp.x, temp.y);
}
+ ScalePos( mouse_pos);
if (last_mouse_pos_ != mouse_pos) {
last_mouse_pos_ = mouse_pos;
HideKeyboardTooltip();
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698