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

Side by Side Diff: ui/views/corewm/tooltip.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_COREWM_TOOLTIP_H_ 5 #ifndef UI_VIEWS_COREWM_TOOLTIP_H_
6 #define UI_VIEWS_COREWM_TOOLTIP_H_ 6 #define UI_VIEWS_COREWM_TOOLTIP_H_
7 7
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "ui/views/views_export.h" 9 #include "ui/views/views_export.h"
10 10
11 namespace aura { 11 namespace aura {
12 class Window; 12 class Window;
13 } 13 }
14 14
15 namespace gfx { 15 namespace gfx {
16 class Point; 16 class Point;
17 } 17 }
18 18
19 namespace test {
20 class TooltipControllerTestHelper;
21 } // namespace test
22
19 namespace views { 23 namespace views {
20 namespace corewm { 24 namespace corewm {
21 25
22 // Tooltip is responsible for showing the tooltip in an appropriate manner. 26 // Tooltip is responsible for showing the tooltip in an appropriate manner.
23 // Tooltip is used by TooltipController. 27 // Tooltip is used by TooltipController.
24 class VIEWS_EXPORT Tooltip { 28 class VIEWS_EXPORT Tooltip {
25 public: 29 public:
26 virtual ~Tooltip() {} 30 virtual ~Tooltip() {}
27 31
28 // Updates the text on the tooltip and resizes to fit. 32 // Updates the text on the tooltip and resizes to fit.
29 virtual void SetText(aura::Window* window, 33 virtual void SetText(aura::Window* window,
30 const base::string16& tooltip_text, 34 const base::string16& tooltip_text,
31 const gfx::Point& location) = 0; 35 const gfx::Point& location) = 0;
32 36
33 // Shows the tooltip at the specified location (in screen coordinates). 37 // Shows the tooltip at the specified location (in screen coordinates).
34 virtual void Show() = 0; 38 virtual void Show() = 0;
35 39
36 // Hides the tooltip. 40 // Hides the tooltip.
37 virtual void Hide() = 0; 41 virtual void Hide() = 0;
38 42
39 // Is the tooltip visibile? 43 // Is the tooltip visibile?
40 virtual bool IsVisible() = 0; 44 virtual bool IsVisible() = 0;
45
46 private:
47 friend class test::TooltipControllerTestHelper;
48
49 virtual gfx::Point GetTooltipPosition() = 0;
sky 2014/04/10 16:12:08 You shouldn't have to expose this to test the fix.
41 }; 50 };
42 51
43 } // namespace corewm 52 } // namespace corewm
44 } // namespace views 53 } // namespace views
45 54
46 #endif // UI_VIEWS_COREWM_TOOLTIP_H_ 55 #endif // UI_VIEWS_COREWM_TOOLTIP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698