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

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

Issue 231733005: Delete the GTK+ port of Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remerge to ToT Created 6 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_GTK_ZOOM_BUBBLE_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_ZOOM_BUBBLE_GTK_H_
7
8 #include <gtk/gtk.h>
9
10 #include "base/basictypes.h"
11 #include "base/timer/timer.h"
12 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
13 #include "content/public/browser/notification_observer.h"
14 #include "content/public/browser/notification_registrar.h"
15 #include "ui/base/gtk/gtk_signal.h"
16
17 typedef struct _GtkWidget GtkWidget;
18
19 class FullscreenController;
20
21 namespace content {
22 class NotificationDetails;
23 class NotificationSource;
24 class WebContents;
25 }
26
27 class ZoomBubbleGtk : public content::NotificationObserver {
28 public:
29 // Shows the zoom bubble below |anchor_widget| with an arrow pointing at
30 // |anchor_widget|. If |anchor_widget| is a toplevel window, the bubble will
31 // fixed positioned in the top right of corner of the widget with no arrow.
32 static void ShowBubble(content::WebContents* web_contents,
33 bool auto_close);
34
35 // Whether the zoom bubble is currently showing.
36 static bool IsShowing();
37
38 // Closes the zoom bubble (if there is one).
39 static void CloseBubble();
40
41 private:
42 ZoomBubbleGtk(GtkWidget* anchor,
43 content::WebContents* web_contents,
44 bool auto_close,
45 FullscreenController* fullscreen_controller);
46
47 virtual ~ZoomBubbleGtk();
48
49 // content::NotificationObserver:
50 virtual void Observe(int type,
51 const content::NotificationSource& source,
52 const content::NotificationDetails& details) OVERRIDE;
53
54 // Convenience method to start |timer_| if |auto_close_| is true.
55 void StartTimerIfNecessary();
56
57 // Stops any close timer if |timer_| is currently running.
58 void StopTimerIfNecessary();
59
60 // Refreshes the bubble by changing the zoom percentage appropriately and
61 // resetting the timer if necessary.
62 void Refresh();
63
64 // Closes the zoom bubble.
65 void Close();
66
67 // Notified when the bubble is destroyed so this instance can be deleted.
68 CHROMEGTK_CALLBACK_0(ZoomBubbleGtk, void, OnDestroy);
69
70 // Fired when the reset link is clicked.
71 CHROMEGTK_CALLBACK_0(ZoomBubbleGtk, void, OnSetDefaultLinkClick);
72
73 // Fired when the mouse enters or leaves the widget.
74 CHROMEGTK_CALLBACK_1(ZoomBubbleGtk, gboolean, OnMouseEnter,
75 GdkEventCrossing*);
76 CHROMEGTK_CALLBACK_1(ZoomBubbleGtk, gboolean, OnMouseLeave,
77 GdkEventCrossing*);
78
79 // Whether the currently displayed bubble will automatically close.
80 bool auto_close_;
81
82 // Whether the mouse is currently inside the bubble.
83 bool mouse_inside_;
84
85 // Timer used to close the bubble when |auto_close_| is true.
86 base::OneShotTimer<ZoomBubbleGtk> timer_;
87
88 // The WebContents for the page whose zoom has changed.
89 content::WebContents* web_contents_;
90
91 // An event box that wraps the content of the bubble.
92 GtkWidget* event_box_;
93
94 // Label showing zoom percentage.
95 GtkWidget* label_;
96
97 // The BubbleGtk object containing the zoom bubble's content.
98 BubbleGtk* bubble_;
99
100 // Used to register for fullscreen change notifications.
101 content::NotificationRegistrar registrar_;
102
103 DISALLOW_COPY_AND_ASSIGN(ZoomBubbleGtk);
104 };
105
106 #endif // CHROME_BROWSER_UI_GTK_ZOOM_BUBBLE_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698