Disable TabDragController tests that fail with a real compositor.
[chromium-blink-merge.git] / chrome / browser / ui / gtk / avatar_menu_button_gtk.h
blob24e4d4f6680fea5156e960b23be48b1862547859
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.
5 #ifndef CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUTTON_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUTTON_GTK_H_
8 #include <gtk/gtk.h>
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
12 #include "ui/base/gtk/gtk_signal.h"
13 #include "ui/base/gtk/owned_widget_gtk.h"
15 class Browser;
16 class SkBitmap;
18 namespace gfx {
19 class Image;
22 // A button used to show the profile avatar. When clicked, it opens the
23 // AvatarMenuBubbleGtk.
24 class AvatarMenuButtonGtk {
25 public:
26 explicit AvatarMenuButtonGtk(Browser* browser);
28 ~AvatarMenuButtonGtk();
30 // Returns the button widget.
31 GtkWidget* widget() const { return widget_.get(); }
33 // Sets the location the arrow should be displayed on the menu bubble.
34 void set_menu_frame_style(BubbleGtk::FrameStyle frame_style) {
35 frame_style_ = frame_style;
38 // Sets the image to display on the button, typically the profile icon.
39 void SetIcon(const gfx::Image& icon, bool is_gaia_picture);
41 // Show the avatar bubble.
42 void ShowAvatarBubble();
44 private:
45 CHROMEGTK_CALLBACK_1(AvatarMenuButtonGtk, gboolean, OnButtonPressed,
46 GdkEventButton*);
47 CHROMEGTK_CALLBACK_1(AvatarMenuButtonGtk, void, OnSizeAllocate,
48 GtkAllocation*);
50 void UpdateButtonIcon();
52 // The button widget.
53 ui::OwnedWidgetGtk widget_;
55 // A weak pointer to the image widget displayed on the button.
56 GtkWidget* image_;
58 // A weak pointer to a browser. Used to create the bubble menu.
59 Browser* browser_;
61 // Which side of the bubble to display the arrow.
62 BubbleGtk::FrameStyle frame_style_;
64 scoped_ptr<gfx::Image> icon_;
65 bool is_gaia_picture_;
66 int old_height_;
68 DISALLOW_COPY_AND_ASSIGN(AvatarMenuButtonGtk);
71 #endif // CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUTTON_GTK_H_