blob: aea76813bc602d67436f9a1456fa0e42762a4b28 (
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
51
52
53
54
55
56
57
58
59
60
61
|
// Copyright (c) 2012 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_UI_GTK_ZOOM_BUBBLE_GTK_H_
#define CHROME_BROWSER_UI_GTK_ZOOM_BUBBLE_GTK_H_
#include "base/basictypes.h"
#include "base/timer.h"
#include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
#include "ui/base/gtk/gtk_signal.h"
class TabContents;
typedef struct _GtkWidget GtkWidget;
class ZoomBubbleGtk {
public:
// Shows the zoom bubble, pointing at |anchor_widget|.
static void Show(GtkWidget* anchor, TabContents* tab_contents,
bool auto_close);
// Closes the zoom bubble.
static void Close();
private:
ZoomBubbleGtk(GtkWidget* anchor, TabContents* tab_contents, bool auto_close);
virtual ~ZoomBubbleGtk();
// Refreshes the bubble by changing the zoom percentage appropriately and
// resetting the timer if necessary.
void Refresh();
// Closes the zoom bubble.
void CloseBubble();
// Notified when the bubble is destroyed so this instance can be deleted.
CHROMEGTK_CALLBACK_0(ZoomBubbleGtk, void, OnDestroy);
// Fired when the reset link is clicked.
CHROMEGTK_CALLBACK_0(ZoomBubbleGtk, void, OnSetDefaultLinkClick);
// Whether the currently displayed bubble will automatically close.
bool auto_close_;
// Timer used to close the bubble when |auto_close_| is true.
base::OneShotTimer<ZoomBubbleGtk> timer_;
// The TabContents for the page whose zoom has changed.
TabContents* tab_contents_;
// Label showing zoom percentage.
GtkWidget* label_;
// The BubbleGtk object containing the zoom bubble's content.
BubbleGtk* bubble_;
DISALLOW_COPY_AND_ASSIGN(ZoomBubbleGtk);
};
#endif // CHROME_BROWSER_UI_GTK_ZOOM_BUBBLE_GTK_H_
|