Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Side by Side Diff: chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h

Issue 7740044: Implement fullscreen info bubble on Win and Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ups Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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_FULLSCREEN_EXIT_BUBBLE_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/ui/fullscreen_exit_bubble.h" 9 #include "chrome/browser/ui/fullscreen_exit_bubble.h"
10 #include "chrome/browser/ui/gtk/slide_animator_gtk.h" 10 #include "chrome/browser/ui/gtk/slide_animator_gtk.h"
11 #include "ui/base/gtk/gtk_signal.h" 11 #include "ui/base/gtk/gtk_signal.h"
12 #include "ui/base/gtk/gtk_signal_registrar.h" 12 #include "ui/base/gtk/gtk_signal_registrar.h"
13 13
14 typedef struct _GtkFloatingContainer GtkFloatingContainer; 14 typedef struct _GtkFloatingContainer GtkFloatingContainer;
15 typedef struct _GtkWidget GtkWidget; 15 typedef struct _GtkWidget GtkWidget;
16 16
17 // FullscreenExitBubbleGTK is responsible for showing a bubble atop the screen 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. 18 // in fullscreen mode, telling users how to exit and providing a click target.
19 class FullscreenExitBubbleGtk : public FullscreenExitBubble { 19 class FullscreenExitBubbleGtk : public FullscreenExitBubble {
20 public: 20 public:
21 // We place the bubble in |container|. 21 // We place the bubble in |container|.
22 FullscreenExitBubbleGtk( 22 FullscreenExitBubbleGtk(
23 GtkFloatingContainer* container, 23 GtkFloatingContainer* container,
24 CommandUpdater::CommandUpdaterDelegate* delegate); 24 Browser* delegate,
25 const GURL& url,
26 bool ask_permission);
25 virtual ~FullscreenExitBubbleGtk(); 27 virtual ~FullscreenExitBubbleGtk();
26 28
27 protected: 29 protected:
28 // FullScreenExitBubble 30 // FullScreenExitBubble
29 virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const OVERRIDE; 31 virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const OVERRIDE;
30 virtual gfx::Point GetCursorScreenPoint() OVERRIDE; 32 virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
31 virtual bool WindowContainsPoint(gfx::Point pos) OVERRIDE; 33 virtual bool WindowContainsPoint(gfx::Point pos) OVERRIDE;
32 virtual bool IsWindowActive() OVERRIDE; 34 virtual bool IsWindowActive() OVERRIDE;
33 virtual void Hide() OVERRIDE; 35 virtual void Hide() OVERRIDE;
34 virtual void Show() OVERRIDE; 36 virtual void Show() OVERRIDE;
35 virtual bool IsAnimating() OVERRIDE; 37 virtual bool IsAnimating() OVERRIDE;
36 38
37 private: 39 private:
38 void InitWidgets(); 40 void InitWidgets();
39 41
40 GtkWidget* widget() const { 42 GtkWidget* widget() const {
41 return slide_widget_->widget(); 43 return slide_widget_->widget();
42 } 44 }
43 45
44 CHROMEGTK_CALLBACK_1(FullscreenExitBubbleGtk, void, OnSetFloatingPosition, 46 CHROMEGTK_CALLBACK_1(FullscreenExitBubbleGtk, void, OnSetFloatingPosition,
45 GtkAllocation*); 47 GtkAllocation*);
46 CHROMEGTK_CALLBACK_0(FullscreenExitBubbleGtk, void, OnLinkClicked); 48 CHROMEGTK_CALLBACK_0(FullscreenExitBubbleGtk, void, OnLinkClicked);
49 CHROMEGTK_CALLBACK_0(FullscreenExitBubbleGtk, void, OnAllowClicked);
50 CHROMEGTK_CALLBACK_0(FullscreenExitBubbleGtk, void, OnDenyClicked);
47 51
48 // A pointer to the floating container that is our parent. 52 // A pointer to the floating container that is our parent.
49 GtkFloatingContainer* container_; 53 GtkFloatingContainer* container_;
50 54
51 // The widget that contains the link. 55 // The widget that contains the link.
52 ui::OwnedWidgetGtk link_container_; 56 ui::OwnedWidgetGtk link_container_;
53 57
54 // The widget that animates the slide-out of fullscreen exit bubble. 58 // The widget that animates the slide-out of fullscreen exit bubble.
55 scoped_ptr<SlideAnimatorGtk> slide_widget_; 59 scoped_ptr<SlideAnimatorGtk> slide_widget_;
56 60
57 // The timer that does the initial hiding of the exit bubble. 61 // The timer that does the initial hiding of the exit bubble.
58 base::OneShotTimer<FullscreenExitBubbleGtk> initial_delay_; 62 base::OneShotTimer<FullscreenExitBubbleGtk> initial_delay_;
59 63
60 ui::GtkSignalRegistrar signals_; 64 ui::GtkSignalRegistrar signals_;
65
66 const GURL& url_;
67 bool show_buttons_;
61 }; 68 };
62 69
63 #endif // CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_ 70 #endif // CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698