| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_GTK_BUBBLE_BUBBLE_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_BUBBLE_BUBBLE_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_BUBBLE_BUBBLE_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_BUBBLE_BUBBLE_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 // Close the bubble if it's open. This will delete the widgets and object, | 86 // Close the bubble if it's open. This will delete the widgets and object, |
| 87 // so you shouldn't hold a BubbleGtk pointer after calling Close(). | 87 // so you shouldn't hold a BubbleGtk pointer after calling Close(). |
| 88 void Close(); | 88 void Close(); |
| 89 | 89 |
| 90 // content::NotificationObserver implementation. | 90 // content::NotificationObserver implementation. |
| 91 virtual void Observe(int type, | 91 virtual void Observe(int type, |
| 92 const content::NotificationSource& source, | 92 const content::NotificationSource& source, |
| 93 const content::NotificationDetails& details) OVERRIDE; | 93 const content::NotificationDetails& details) OVERRIDE; |
| 94 | 94 |
| 95 // If the content contains widgets that can steal our pointer and keyboard | |
| 96 // grabs (e.g. GtkComboBox), this method should be called after a widget | |
| 97 // releases the grabs so we can reacquire them. Note that this causes a race | |
| 98 // condition; another client could grab them before we do (ideally, GDK would | |
| 99 // transfer the grabs back to us when the widget releases them). The window | |
| 100 // is small, though, and the worst-case scenario for this seems to just be | |
| 101 // that the content's widgets will appear inactive even after the user clicks | |
| 102 // in them. | |
| 103 void HandlePointerAndKeyboardUngrabbedByContent(); | |
| 104 | |
| 105 // Change an input-grabbing bubble into a non-input-grabbing bubble. This | 95 // Change an input-grabbing bubble into a non-input-grabbing bubble. This |
| 106 // allows a window to change from auto closing when it loses to focus to being | 96 // allows a window to change from auto closing when it loses to focus to being |
| 107 // a window that does not auto close, and is useful if an auto closing window | 97 // a window that does not auto close, and is useful if an auto closing window |
| 108 // starts being inspected. | 98 // starts being inspected. |
| 109 void StopGrabbingInput(); | 99 void StopGrabbingInput(); |
| 110 | 100 |
| 111 GtkWidget* anchor_widget() { return anchor_widget_; } | 101 GtkWidget* anchor_widget() { return anchor_widget_; } |
| 112 | 102 |
| 113 private: | 103 private: |
| 114 FRIEND_TEST_ALL_PREFIXES(BubbleGtkTest, ArrowLocation); | 104 FRIEND_TEST_ALL_PREFIXES(BubbleGtkTest, ArrowLocation); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 void GrabPointerAndKeyboard(); | 163 void GrabPointerAndKeyboard(); |
| 174 | 164 |
| 175 CHROMEG_CALLBACK_3(BubbleGtk, gboolean, OnGtkAccelerator, GtkAccelGroup*, | 165 CHROMEG_CALLBACK_3(BubbleGtk, gboolean, OnGtkAccelerator, GtkAccelGroup*, |
| 176 GObject*, guint, GdkModifierType); | 166 GObject*, guint, GdkModifierType); |
| 177 | 167 |
| 178 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnExpose, GdkEventExpose*); | 168 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnExpose, GdkEventExpose*); |
| 179 CHROMEGTK_CALLBACK_1(BubbleGtk, void, OnSizeAllocate, GtkAllocation*); | 169 CHROMEGTK_CALLBACK_1(BubbleGtk, void, OnSizeAllocate, GtkAllocation*); |
| 180 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnButtonPress, GdkEventButton*); | 170 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnButtonPress, GdkEventButton*); |
| 181 CHROMEGTK_CALLBACK_0(BubbleGtk, gboolean, OnDestroy); | 171 CHROMEGTK_CALLBACK_0(BubbleGtk, gboolean, OnDestroy); |
| 182 CHROMEGTK_CALLBACK_0(BubbleGtk, void, OnHide); | 172 CHROMEGTK_CALLBACK_0(BubbleGtk, void, OnHide); |
| 173 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnGrabBroken, GdkEventGrabBroken*); |
| 174 CHROMEGTK_CALLBACK_0(BubbleGtk, void, OnForeshadowWidgetHide); |
| 183 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnToplevelConfigure, | 175 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnToplevelConfigure, |
| 184 GdkEventConfigure*); | 176 GdkEventConfigure*); |
| 185 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnToplevelUnmap, GdkEvent*); | 177 CHROMEGTK_CALLBACK_1(BubbleGtk, gboolean, OnToplevelUnmap, GdkEvent*); |
| 186 CHROMEGTK_CALLBACK_1(BubbleGtk, void, OnAnchorAllocate, GtkAllocation*); | 178 CHROMEGTK_CALLBACK_1(BubbleGtk, void, OnAnchorAllocate, GtkAllocation*); |
| 187 | 179 |
| 188 // The caller supplied delegate, can be NULL. | 180 // The caller supplied delegate, can be NULL. |
| 189 BubbleDelegateGtk* delegate_; | 181 BubbleDelegateGtk* delegate_; |
| 190 | 182 |
| 191 // Our GtkWindow popup window, we don't technically "own" the widget, since | 183 // Our GtkWindow popup window, we don't technically "own" the widget, since |
| 192 // it deletes us when it is destroyed. | 184 // it deletes us when it is destroyed. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 bool closed_by_escape_; | 225 bool closed_by_escape_; |
| 234 | 226 |
| 235 content::NotificationRegistrar registrar_; | 227 content::NotificationRegistrar registrar_; |
| 236 | 228 |
| 237 ui::GtkSignalRegistrar signals_; | 229 ui::GtkSignalRegistrar signals_; |
| 238 | 230 |
| 239 DISALLOW_COPY_AND_ASSIGN(BubbleGtk); | 231 DISALLOW_COPY_AND_ASSIGN(BubbleGtk); |
| 240 }; | 232 }; |
| 241 | 233 |
| 242 #endif // CHROME_BROWSER_UI_GTK_BUBBLE_BUBBLE_GTK_H_ | 234 #endif // CHROME_BROWSER_UI_GTK_BUBBLE_BUBBLE_GTK_H_ |
| OLD | NEW |