Chromium Code Reviews| Index: chrome/browser/gtk/info_bubble_gtk.h |
| diff --git a/chrome/browser/gtk/info_bubble_gtk.h b/chrome/browser/gtk/info_bubble_gtk.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d5a3b7b8d4d02172b433352d3661c47b674ef31d |
| --- /dev/null |
| +++ b/chrome/browser/gtk/info_bubble_gtk.h |
| @@ -0,0 +1,72 @@ |
| +// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_GTK_INFO_BUBBLE_GTK_H_ |
| +#define CHROME_BROWSER_GTK_INFO_BUBBLE_GTK_H_ |
| + |
| +#include "base/basictypes.h" |
|
ecattell
2009/04/30 19:55:37
Out of order includes:
http://www.corp.google.com
Dean McNamee
2009/05/01 15:01:46
Fixed, sorry.
On 2009/04/30 19:55:37, ecattell wr
|
| + |
| +#include <gtk/gtk.h> |
| + |
| +namespace gfx { |
| +class Rect; |
| +} |
| + |
| +class InfoBubbleGtk { |
| + public: |
| + // Show an InfoBubble, pointing at the area |rect| (in screen coordinates). |
| + // An infobubble will try to fit on the screen, so it can point to any edge |
| + // of |rect|. The bubble will host |widget| as the content. |
|
ecattell
2009/04/30 19:55:37
widget -> content?
Dean McNamee
2009/05/01 15:01:46
Fixed.
|
| + static InfoBubbleGtk* Show(const gfx::Rect& rect, GtkWidget* content); |
| + |
| + InfoBubbleGtk(); |
| + virtual ~InfoBubbleGtk(); |
| + |
| + void Close(); |
|
ecattell
2009/04/30 19:55:37
What does Close() do? And if it is just a wrapper
Dean McNamee
2009/05/01 15:01:46
Heh, that's a good question. I am not even sure i
|
| + |
| + private: |
| + // Creates the InfoBubble. |
| + void Init(const gfx::Rect& rect, GtkWidget* content); |
| + |
| + // Closes the window notifying the delegate. |closed_by_escape| is true if |
|
ecattell
2009/04/30 19:55:37
notifying -> and notifies
Dean McNamee
2009/05/01 15:01:46
Yeah, and I don't actually even have a delegate ri
|
| + // the close is the result of pressing escape. |
| + void Close(bool closed_by_escape); |
| + |
| + static gboolean HandleConfigureThunk(GtkWidget* widget, |
| + GdkEventConfigure* event, |
| + gpointer user_data) { |
| + return reinterpret_cast<InfoBubbleGtk*>(user_data)->HandleConfigure(event); |
| + } |
| + gboolean HandleConfigure(GdkEventConfigure* event); |
| + |
| + static gboolean HandleButtonPressThunk(GtkWidget* widget, |
| + GdkEventButton* event, |
| + gpointer userdata) { |
| + return reinterpret_cast<InfoBubbleGtk*>(userdata)-> |
| + HandleButtonPress(event); |
| + } |
| + gboolean HandleButtonPress(GdkEventButton* event); |
| + |
| + static gboolean HandleButtonReleaseThunk(GtkWidget* widget, |
| + GdkEventButton* event, |
| + gpointer userdata) { |
| + return reinterpret_cast<InfoBubbleGtk*>(userdata)-> |
| + HandleButtonRelease(event); |
| + } |
| + gboolean HandleButtonRelease(GdkEventButton* event); |
| + |
| + // Our GtkWindow popup window. |
| + GtkWidget* window_; |
| + |
| + // Where we want our window to be positioned on the screen. |
| + int screen_x_; |
| + int screen_y_; |
| + |
| + // Have we been closed? |
| + bool closed_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(InfoBubbleGtk); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_GTK_INFO_BUBBLE_GTK_H_ |