OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_VIEWS_WIDGET_TOOLTIP_MANAGER_GTK_H_ | |
6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_GTK_H_ | |
7 #pragma once | |
8 | |
9 #include <gtk/gtk.h> | |
10 | |
11 #include "base/compiler_specific.h" | |
12 #include "ui/base/gtk/tooltip_window_gtk.h" | |
13 #include "ui/views/widget/tooltip_manager.h" | |
14 | |
15 namespace views { | |
16 | |
17 class NativeWidgetGtk; | |
18 | |
19 // TooltipManager implementation for Gtk. | |
20 class TooltipManagerGtk : public TooltipManager { | |
21 public: | |
22 explicit TooltipManagerGtk(NativeWidgetGtk* widget); | |
23 virtual ~TooltipManagerGtk() {} | |
24 | |
25 // Shows the tooltip at the specified location. Returns true if the tooltip | |
26 // should be shown, false otherwise. | |
27 bool ShowTooltip(int x, int y, bool for_keyboard, GtkTooltip* gtk_tooltip); | |
28 | |
29 // TooltipManager. | |
30 virtual void UpdateTooltip() OVERRIDE; | |
31 virtual void TooltipTextChanged(View* view) OVERRIDE; | |
32 virtual void ShowKeyboardTooltip(View* view) OVERRIDE; | |
33 virtual void HideKeyboardTooltip() OVERRIDE; | |
34 | |
35 private: | |
36 // Sends the show_help signal to widget_. This signal triggers showing the | |
37 // keyboard tooltip if it isn't showing, or hides it if it is showing. | |
38 bool SendShowHelpSignal(); | |
39 | |
40 // Our owner. | |
41 NativeWidgetGtk* widget_; | |
42 | |
43 // The view supplied to the last invocation of ShowKeyboardTooltip. | |
44 View* keyboard_view_; | |
45 | |
46 // Customized tooltip window. | |
47 ui::TooltipWindowGtk tooltip_window_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(TooltipManagerGtk); | |
50 }; | |
51 | |
52 } // namespace views | |
53 | |
54 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_GTK_H_ | |
OLD | NEW |