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 CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_ 7 #pragma once 8 9 #include "base/timer.h" 10 #include "chrome/browser/ui/gtk/slide_animator_gtk.h" 11 #include "ui/base/gtk/gtk_signal.h" 12 #include "ui/base/gtk/gtk_signal_registrar.h" 13 14 typedef struct _GtkFloatingContainer GtkFloatingContainer; 15 typedef struct _GtkWidget GtkWidget; 16 17 // FullscreenExitBubbleGTK is responsible for showing a bubble atop the screen 18 // in fullscreen mode, telling users how to exit and providing a click target. 19 class FullscreenExitBubbleGtk { 20 public: 21 // We place the bubble in |container|. 22 explicit FullscreenExitBubbleGtk(GtkFloatingContainer* container); 23 virtual ~FullscreenExitBubbleGtk(); 24 25 void InitWidgets(); 26 27 private: widget()28 GtkWidget* widget() const { 29 return slide_widget_->widget(); 30 } 31 32 // Hide the exit bubble. 33 void Hide(); 34 35 CHROMEGTK_CALLBACK_1(FullscreenExitBubbleGtk, void, OnSetFloatingPosition, 36 GtkAllocation*); 37 CHROMEGTK_CALLBACK_0(FullscreenExitBubbleGtk, void, OnLinkClicked); 38 39 // A pointer to the floating container that is our parent. 40 GtkFloatingContainer* container_; 41 42 // The widget that animates the slide-out of fullscreen exit bubble. 43 scoped_ptr<SlideAnimatorGtk> slide_widget_; 44 45 // The timer that does the initial hiding of the exit bubble. 46 base::OneShotTimer<FullscreenExitBubbleGtk> initial_delay_; 47 48 ui::GtkSignalRegistrar signals_; 49 }; 50 51 #endif // CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_ 52