| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright (c) 2010 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_WINDOW_GTK_H_ | 
|  | 6 #define VIEWS_WIDGET_TOOLTIP_WINDOW_GTK_H_ | 
|  | 7 | 
|  | 8 #include <gtk/gtk.h> | 
|  | 9 #include <string> | 
|  | 10 | 
|  | 11 #include "app/gtk_signal.h" | 
|  | 12 | 
|  | 13 namespace views { | 
|  | 14 | 
|  | 15 // TooltipWindowGtk provides a customized tooltip window and gives us a | 
|  | 16 // chance to apply RGBA colormap on it. This enables the GTK theme engine to | 
|  | 17 // draw tooltip with nice shadow and rounded corner on ChromeOS. | 
|  | 18 class TooltipWindowGtk { | 
|  | 19  public: | 
|  | 20   explicit TooltipWindowGtk(GtkWidget* widget); | 
|  | 21   ~TooltipWindowGtk(); | 
|  | 22 | 
|  | 23   // Sets tooltip text to display. | 
|  | 24   void SetTooltipText(const std::wstring& text); | 
|  | 25 | 
|  | 26   GtkLabel* label() { | 
|  | 27     return GTK_LABEL(label_); | 
|  | 28   } | 
|  | 29 | 
|  | 30  protected: | 
|  | 31   CHROMEGTK_CALLBACK_1(TooltipWindowGtk, gboolean, OnPaint, GdkEventExpose*); | 
|  | 32   CHROMEGTK_CALLBACK_1(TooltipWindowGtk, void, OnStyleSet, GtkStyle*); | 
|  | 33 | 
|  | 34  private: | 
|  | 35   void Init(); | 
|  | 36 | 
|  | 37   // Underlying widget of this tooltip window. | 
|  | 38   GtkWidget* host_; | 
|  | 39 | 
|  | 40   // GtkWindow of this tooltip window. | 
|  | 41   GtkWidget* window_; | 
|  | 42 | 
|  | 43   // The alignment and label widgets contained of the tooltip window. | 
|  | 44   GtkWidget* alignment_; | 
|  | 45   GtkWidget* label_; | 
|  | 46 | 
|  | 47   DISALLOW_COPY_AND_ASSIGN(TooltipWindowGtk); | 
|  | 48 }; | 
|  | 49 | 
|  | 50 } // namespace views | 
|  | 51 | 
|  | 52 #endif  // VIEWS_WIDGET_TOOLTIP_WINDOW_GTK_H_ | 
| OLD | NEW | 
|---|