Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 // If |source| has capture this finds the Widget under the mouse and invokes | 32 // If |source| has capture this finds the Widget under the mouse and invokes |
| 33 // UpdateTooltip() on it's TooltipManager. This is necessary as when capture | 33 // UpdateTooltip() on it's TooltipManager. This is necessary as when capture |
| 34 // is held mouse events are only delivered to the Window that has capture even | 34 // is held mouse events are only delivered to the Window that has capture even |
| 35 // though we may show tooltips for the Window under the mouse. | 35 // though we may show tooltips for the Window under the mouse. |
| 36 static void UpdateTooltipManagerForCapture(Widget* source); | 36 static void UpdateTooltipManagerForCapture(Widget* source); |
| 37 | 37 |
| 38 // Returns the FontList used by all TooltipManagerAuras. | 38 // Returns the FontList used by all TooltipManagerAuras. |
| 39 static const gfx::FontList& GetDefaultFontList(); | 39 static const gfx::FontList& GetDefaultFontList(); |
| 40 | 40 |
| 41 // TooltipManager: | 41 // TooltipManager: |
| 42 int GetMaxWidth(const gfx::Point& location, | 42 int GetMaxWidth(const gfx::Point& location) const override; |
| 43 aura::Window* context) const override; | |
| 44 const gfx::FontList& GetFontList() const override; | 43 const gfx::FontList& GetFontList() const override; |
| 45 void UpdateTooltip() override; | 44 void UpdateTooltip() override; |
| 46 void TooltipTextChanged(View* view) override; | 45 void TooltipTextChanged(View* view) override; |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 View* GetViewUnderPoint(const gfx::Point& point); | 48 View* GetViewUnderPoint(const gfx::Point& point); |
| 50 void UpdateTooltipForTarget(View* target, | 49 void UpdateTooltipForTarget(View* target, |
| 51 const gfx::Point& point, | 50 const gfx::Point& point, |
| 52 aura::Window* root_window); | 51 aura::Window* root_window); |
| 53 | 52 |
| 54 // Returns the Window the tooltip text is installed on. | 53 // Returns the Window the tooltip text is installed on. |
| 55 aura::Window* GetWindow(); | 54 aura::Window* GetWindow() const; |
|
oshima
2016/01/19 20:44:31
I believe this const is intentional (as it returns
scottmg
2016/01/19 21:55:58
Undid that.
| |
| 56 | 55 |
| 57 Widget* widget_; | 56 Widget* widget_; |
| 58 base::string16 tooltip_text_; | 57 base::string16 tooltip_text_; |
| 59 | 58 |
| 60 DISALLOW_COPY_AND_ASSIGN(TooltipManagerAura); | 59 DISALLOW_COPY_AND_ASSIGN(TooltipManagerAura); |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 } // namespace views | 62 } // namespace views |
| 64 | 63 |
| 65 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ | 64 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ |
| OLD | NEW |