| OLD | NEW |
| 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_AVATAR_MENU_BUTTON_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUTTON_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUTTON_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUTTON_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 GtkWidget* widget() const { return widget_.get(); } | 27 GtkWidget* widget() const { return widget_.get(); } |
| 28 | 28 |
| 29 // Sets the location the arrow should be displayed on the menu bubble. | 29 // Sets the location the arrow should be displayed on the menu bubble. |
| 30 void set_menu_arrow_location(BubbleGtk::ArrowLocationGtk arrow_location) { | 30 void set_menu_arrow_location(BubbleGtk::ArrowLocationGtk arrow_location) { |
| 31 arrow_location_ = arrow_location; | 31 arrow_location_ = arrow_location; |
| 32 } | 32 } |
| 33 | 33 |
| 34 // Sets the image to display on the button, typically the profile icon. | 34 // Sets the image to display on the button, typically the profile icon. |
| 35 void SetIcon(const SkBitmap &icon); | 35 void SetIcon(const SkBitmap &icon); |
| 36 | 36 |
| 37 // Show the avatar bubble. |
| 38 void ShowAvatarBubble(); |
| 39 |
| 37 private: | 40 private: |
| 38 CHROMEGTK_CALLBACK_1(AvatarMenuButtonGtk, gboolean, OnButtonPressed, | 41 CHROMEGTK_CALLBACK_1(AvatarMenuButtonGtk, gboolean, OnButtonPressed, |
| 39 GdkEventButton*); | 42 GdkEventButton*); |
| 40 | 43 |
| 41 // The button widget. | 44 // The button widget. |
| 42 ui::OwnedWidgetGtk widget_; | 45 ui::OwnedWidgetGtk widget_; |
| 43 | 46 |
| 44 // A weak pointer to the image widget displayed on the button. | 47 // A weak pointer to the image widget displayed on the button. |
| 45 GtkWidget* image_; | 48 GtkWidget* image_; |
| 46 | 49 |
| 47 // A weak pointer to a browser. Used to create the bubble menu. | 50 // A weak pointer to a browser. Used to create the bubble menu. |
| 48 Browser* browser_; | 51 Browser* browser_; |
| 49 | 52 |
| 50 // Which side of the bubble to display the arrow. | 53 // Which side of the bubble to display the arrow. |
| 51 BubbleGtk::ArrowLocationGtk arrow_location_; | 54 BubbleGtk::ArrowLocationGtk arrow_location_; |
| 52 | 55 |
| 53 DISALLOW_COPY_AND_ASSIGN(AvatarMenuButtonGtk); | 56 DISALLOW_COPY_AND_ASSIGN(AvatarMenuButtonGtk); |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 #endif // CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUTTON_GTK_H_ | 59 #endif // CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUTTON_GTK_H_ |
| OLD | NEW |