| 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 VIEWS_WIDGET_TOOLTIP_MANAGER_VIEWS_H_ | 5 #ifndef VIEWS_WIDGET_TOOLTIP_MANAGER_VIEWS_H_ |
| 6 #define VIEWS_WIDGET_TOOLTIP_MANAGER_VIEWS_H_ | 6 #define VIEWS_WIDGET_TOOLTIP_MANAGER_VIEWS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/timer.h" | 10 #include "base/timer.h" |
| 11 #include "views/controls/label.h" | 11 #include "views/controls/label.h" |
| 12 #include "views/widget/native_widget.h" | 12 #include "views/widget/native_widget.h" |
| 13 #include "views/widget/tooltip_manager.h" | 13 #include "views/widget/tooltip_manager.h" |
| 14 #include "views/widget/widget_delegate.h" | 14 #include "views/widget/widget_delegate.h" |
| 15 #include "views/view.h" | 15 #include "views/view.h" |
| 16 | 16 |
| 17 #if defined(USE_X11) | 17 #if defined(USE_X11) |
| 18 typedef union _XEvent XEvent; | 18 typedef union _XEvent XEvent; |
| 19 namespace ui { | 19 namespace ui { |
| 20 union WaylandEvent; | 20 union WaylandEvent; |
| 21 } | 21 } |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 namespace views { | 24 namespace views { |
| 25 | 25 |
| 26 namespace internal { | |
| 27 class RootView; | |
| 28 } | |
| 29 | |
| 30 class Widget; | 26 class Widget; |
| 31 | 27 |
| 32 // TooltipManager implementation for Views. | 28 // TooltipManager implementation for Views. |
| 33 class TooltipManagerViews : public TooltipManager, | 29 class TooltipManagerViews : public TooltipManager, |
| 34 public MessageLoopForUI::Observer { | 30 public MessageLoopForUI::Observer { |
| 35 public: | 31 public: |
| 36 explicit TooltipManagerViews(internal::RootView* root_view); | 32 explicit TooltipManagerViews(views::View* root_view); |
| 37 virtual ~TooltipManagerViews(); | 33 virtual ~TooltipManagerViews(); |
| 38 | 34 |
| 39 // TooltipManager. | 35 // TooltipManager. |
| 40 virtual void UpdateTooltip() OVERRIDE; | 36 virtual void UpdateTooltip() OVERRIDE; |
| 41 virtual void TooltipTextChanged(View* view) OVERRIDE; | 37 virtual void TooltipTextChanged(View* view) OVERRIDE; |
| 42 virtual void ShowKeyboardTooltip(View* view) OVERRIDE; | 38 virtual void ShowKeyboardTooltip(View* view) OVERRIDE; |
| 43 virtual void HideKeyboardTooltip() OVERRIDE; | 39 virtual void HideKeyboardTooltip() OVERRIDE; |
| 44 | 40 |
| 45 #if defined(USE_WAYLAND) | 41 #if defined(USE_WAYLAND) |
| 46 virtual base::MessagePumpObserver::EventStatus WillProcessEvent( | 42 virtual base::MessagePumpObserver::EventStatus WillProcessEvent( |
| (...skipping 22 matching lines...) Expand all Loading... |
| 69 void SetTooltipBounds(gfx::Point mouse_pos, int tooltip_width, | 65 void SetTooltipBounds(gfx::Point mouse_pos, int tooltip_width, |
| 70 int tooltip_height); | 66 int tooltip_height); |
| 71 | 67 |
| 72 // Creates a widget of type TYPE_TOOLTIP | 68 // Creates a widget of type TYPE_TOOLTIP |
| 73 Widget* CreateTooltip(); | 69 Widget* CreateTooltip(); |
| 74 | 70 |
| 75 // Invoked when the mose moves. | 71 // Invoked when the mose moves. |
| 76 void OnMouseMoved(int x, int y); | 72 void OnMouseMoved(int x, int y); |
| 77 | 73 |
| 78 scoped_ptr<Widget> tooltip_widget_; | 74 scoped_ptr<Widget> tooltip_widget_; |
| 79 internal::RootView* root_view_; | 75 views::View* root_view_; |
| 80 View* tooltip_view_; | 76 View* tooltip_view_; |
| 81 string16 tooltip_text_; | 77 string16 tooltip_text_; |
| 82 Label tooltip_label_; | 78 Label tooltip_label_; |
| 83 | 79 |
| 84 gfx::Point curr_mouse_pos_; | 80 gfx::Point curr_mouse_pos_; |
| 85 base::RepeatingTimer<TooltipManagerViews> tooltip_timer_; | 81 base::RepeatingTimer<TooltipManagerViews> tooltip_timer_; |
| 86 | 82 |
| 87 DISALLOW_COPY_AND_ASSIGN(TooltipManagerViews); | 83 DISALLOW_COPY_AND_ASSIGN(TooltipManagerViews); |
| 88 }; | 84 }; |
| 89 | 85 |
| 90 } // namespace views | 86 } // namespace views |
| 91 | 87 |
| 92 #endif // VIEWS_WIDGET_TOOLTIP_MANAGER_VIEWS_H_ | 88 #endif // VIEWS_WIDGET_TOOLTIP_MANAGER_VIEWS_H_ |
| OLD | NEW |