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

Side by Side Diff: ui/views/widget/tooltip_manager_aura.h

Issue 213833018: Aura tooltips do not move on mouse move in case of many neighboring views with the same label (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Write unit test for the case when a tooltip moves from one view to another with the same tooltip bu… Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ 5 #ifndef UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_
6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ 6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "ui/gfx/point.h" 10 #include "ui/gfx/point.h"
11 #include "ui/gfx/rect.h"
11 #include "ui/views/widget/tooltip_manager.h" 12 #include "ui/views/widget/tooltip_manager.h"
12 13
13 namespace aura { 14 namespace aura {
14 class Window; 15 class Window;
15 } 16 }
16 17
17 namespace gfx { 18 namespace gfx {
18 class FontList; 19 class FontList;
19 } 20 }
20 21
21 namespace views { 22 namespace views {
22 23
24 class View;
23 class Widget; 25 class Widget;
24 26
25 // TooltipManager implementation for Aura. 27 // TooltipManager implementation for Aura.
26 class TooltipManagerAura : public TooltipManager { 28 class TooltipManagerAura : public TooltipManager {
27 public: 29 public:
28 explicit TooltipManagerAura(Widget* widget); 30 explicit TooltipManagerAura(Widget* widget);
29 virtual ~TooltipManagerAura(); 31 virtual ~TooltipManagerAura();
30 32
31 // If |source| has capture this finds the Widget under the mouse and invokes 33 // If |source| has capture this finds the Widget under the mouse and invokes
32 // UpdateTooltip() on it's TooltipManager. This is necessary as when capture 34 // UpdateTooltip() on it's TooltipManager. This is necessary as when capture
(...skipping 14 matching lines...) Expand all
47 void UpdateTooltipForTarget(View* target, 49 void UpdateTooltipForTarget(View* target,
48 const gfx::Point& point, 50 const gfx::Point& point,
49 aura::Window* root_window); 51 aura::Window* root_window);
50 52
51 // Returns the Window the tooltip text is installed on. 53 // Returns the Window the tooltip text is installed on.
52 aura::Window* GetWindow(); 54 aura::Window* GetWindow();
53 55
54 Widget* widget_; 56 Widget* widget_;
55 base::string16 tooltip_text_; 57 base::string16 tooltip_text_;
56 58
59 // Bounds of the view for which the last managed tooltip was displayed.
60 gfx::Rect origin_bounds_;
61
57 DISALLOW_COPY_AND_ASSIGN(TooltipManagerAura); 62 DISALLOW_COPY_AND_ASSIGN(TooltipManagerAura);
58 }; 63 };
59 64
60 } // namespace views 65 } // namespace views
61 66
62 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ 67 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698