summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/fullscreen_exit_bubble_gtk.h
blob: 44b3ac0bd3d3c6b7ab628a634c2555adc9e34e2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// 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_FULLSCREEN_EXIT_BUBBLE_GTK_H_
#define CHROME_BROWSER_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_

#include <gtk/gtk.h>

#include "base/timer.h"
#include "chrome/browser/gtk/slide_animator_gtk.h"

typedef struct _GtkFloatingContainer GtkFloatingContainer;

// FullscreenExitBubbleGTK is responsible for showing a bubble atop the screen
// in fullscreen mode, telling users how to exit and providing a click target.
class FullscreenExitBubbleGtk {
 public:
  // We place the bubble in |container|.
  explicit FullscreenExitBubbleGtk(GtkFloatingContainer* container);
  ~FullscreenExitBubbleGtk();

  void InitWidgets();

 private:
  GtkWidget* widget() const {
    return slide_widget_->widget();
  }

  // Hide the exit bubble.
  void Hide();

  static void OnSetFloatingPosition(GtkFloatingContainer* floating_container,
                                    GtkAllocation* allocation,
                                    FullscreenExitBubbleGtk* bubble);

  static void OnLinkClicked(GtkWidget* link,
                            FullscreenExitBubbleGtk* bubble);

  // A pointer to the floating container that is our parent.
  GtkFloatingContainer* container_;

  // The widget that animates the slide-out of fullscreen exit bubble.
  scoped_ptr<SlideAnimatorGtk> slide_widget_;

  // The timer that does the initial hiding of the exit bubble.
  base::OneShotTimer<FullscreenExitBubbleGtk> initial_delay_;
};

#endif  // CHROME_BROWSER_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_