OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2009 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 CHROME_BROWSER_GTK_INFO_BUBBLE_GTK_H_ | |
6 #define CHROME_BROWSER_GTK_INFO_BUBBLE_GTK_H_ | |
7 | |
8 #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
| |
9 | |
10 #include <gtk/gtk.h> | |
11 | |
12 namespace gfx { | |
13 class Rect; | |
14 } | |
15 | |
16 class InfoBubbleGtk { | |
17 public: | |
18 // Show an InfoBubble, pointing at the area |rect| (in screen coordinates). | |
19 // An infobubble will try to fit on the screen, so it can point to any edge | |
20 // 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.
| |
21 static InfoBubbleGtk* Show(const gfx::Rect& rect, GtkWidget* content); | |
22 | |
23 InfoBubbleGtk(); | |
24 virtual ~InfoBubbleGtk(); | |
25 | |
26 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
| |
27 | |
28 private: | |
29 // Creates the InfoBubble. | |
30 void Init(const gfx::Rect& rect, GtkWidget* content); | |
31 | |
32 // 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
| |
33 // the close is the result of pressing escape. | |
34 void Close(bool closed_by_escape); | |
35 | |
36 static gboolean HandleConfigureThunk(GtkWidget* widget, | |
37 GdkEventConfigure* event, | |
38 gpointer user_data) { | |
39 return reinterpret_cast<InfoBubbleGtk*>(user_data)->HandleConfigure(event); | |
40 } | |
41 gboolean HandleConfigure(GdkEventConfigure* event); | |
42 | |
43 static gboolean HandleButtonPressThunk(GtkWidget* widget, | |
44 GdkEventButton* event, | |
45 gpointer userdata) { | |
46 return reinterpret_cast<InfoBubbleGtk*>(userdata)-> | |
47 HandleButtonPress(event); | |
48 } | |
49 gboolean HandleButtonPress(GdkEventButton* event); | |
50 | |
51 static gboolean HandleButtonReleaseThunk(GtkWidget* widget, | |
52 GdkEventButton* event, | |
53 gpointer userdata) { | |
54 return reinterpret_cast<InfoBubbleGtk*>(userdata)-> | |
55 HandleButtonRelease(event); | |
56 } | |
57 gboolean HandleButtonRelease(GdkEventButton* event); | |
58 | |
59 // Our GtkWindow popup window. | |
60 GtkWidget* window_; | |
61 | |
62 // Where we want our window to be positioned on the screen. | |
63 int screen_x_; | |
64 int screen_y_; | |
65 | |
66 // Have we been closed? | |
67 bool closed_; | |
68 | |
69 DISALLOW_COPY_AND_ASSIGN(InfoBubbleGtk); | |
70 }; | |
71 | |
72 #endif // CHROME_BROWSER_GTK_INFO_BUBBLE_GTK_H_ | |
OLD | NEW |