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