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/corewm/tooltip_aura.h

Issue 2556083002: Don't subtract border from max size for display rect. (Closed)
Patch Set: RenderTextTestApi Created 4 years 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_AURA_H_ 5 #ifndef UI_VIEWS_COREWM_TOOLTIP_AURA_H_
6 #define UI_VIEWS_COREWM_TOOLTIP_AURA_H_ 6 #define UI_VIEWS_COREWM_TOOLTIP_AURA_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/views/corewm/tooltip.h" 11 #include "ui/views/corewm/tooltip.h"
12 #include "ui/views/widget/widget_observer.h" 12 #include "ui/views/widget/widget_observer.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 class Size; 15 class Size;
16 } // namespace gfx 16 } // namespace gfx
17 17
18 namespace views { 18 namespace views {
19 19
20 class Widget; 20 class Widget;
21 21
22 namespace corewm { 22 namespace corewm {
23 23
24 // Implementation of Tooltip that shows the tooltip using a Widget and Label. 24 // Implementation of Tooltip that shows the tooltip using a Widget and Label.
25 class VIEWS_EXPORT TooltipAura : public Tooltip, public WidgetObserver { 25 class VIEWS_EXPORT TooltipAura : public Tooltip, public WidgetObserver {
26 public: 26 public:
27 TooltipAura(); 27 TooltipAura();
28 ~TooltipAura() override; 28 ~TooltipAura() override;
29 29
30 // Returns the number of text lines, only for unit test.
31 size_t GetLineSizeForTest();
32
30 private: 33 private:
31 class TooltipView; 34 class TooltipView;
32 35
33 // Adjusts the bounds given by the arguments to fit inside the desktop 36 // Adjusts the bounds given by the arguments to fit inside the desktop
34 // and applies the adjusted bounds to the label_. 37 // and applies the adjusted bounds to the label_.
35 void SetTooltipBounds(const gfx::Point& mouse_pos, 38 void SetTooltipBounds(const gfx::Point& mouse_pos,
36 const gfx::Size& tooltip_size); 39 const gfx::Size& tooltip_size);
37 40
38 // Destroys |widget_|. 41 // Destroys |widget_|.
39 void DestroyWidget(); 42 void DestroyWidget();
(...skipping 20 matching lines...) Expand all
60 // showing. 63 // showing.
61 aura::Window* tooltip_window_; 64 aura::Window* tooltip_window_;
62 65
63 DISALLOW_COPY_AND_ASSIGN(TooltipAura); 66 DISALLOW_COPY_AND_ASSIGN(TooltipAura);
64 }; 67 };
65 68
66 } // namespace corewm 69 } // namespace corewm
67 } // namespace views 70 } // namespace views
68 71
69 #endif // UI_VIEWS_COREWM_TOOLTIP_AURA_H_ 72 #endif // UI_VIEWS_COREWM_TOOLTIP_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698