OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_BUBBLE_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUBBLE_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUBBLE_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUBBLE_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual void OpenProfile(size_t profile_index) OVERRIDE; | 44 virtual void OpenProfile(size_t profile_index) OVERRIDE; |
45 virtual void EditProfile(size_t profile_index) OVERRIDE; | 45 virtual void EditProfile(size_t profile_index) OVERRIDE; |
46 | 46 |
47 private: | 47 private: |
48 // Notified when |contents_| is destroyed so we can delete our instance. | 48 // Notified when |contents_| is destroyed so we can delete our instance. |
49 CHROMEGTK_CALLBACK_0(AvatarMenuBubbleGtk, void, OnDestroy); | 49 CHROMEGTK_CALLBACK_0(AvatarMenuBubbleGtk, void, OnDestroy); |
50 CHROMEGTK_CALLBACK_1(AvatarMenuBubbleGtk, void, OnSizeRequest, | 50 CHROMEGTK_CALLBACK_1(AvatarMenuBubbleGtk, void, OnSizeRequest, |
51 GtkRequisition*); | 51 GtkRequisition*); |
52 CHROMEGTK_CALLBACK_0(AvatarMenuBubbleGtk, void, OnNewProfileLinkClicked); | 52 CHROMEGTK_CALLBACK_0(AvatarMenuBubbleGtk, void, OnNewProfileLinkClicked); |
53 CHROMEGTK_CALLBACK_0(AvatarMenuBubbleGtk, void, OnSwitchProfileLinkClicked); | 53 CHROMEGTK_CALLBACK_0(AvatarMenuBubbleGtk, void, OnSwitchProfileLinkClicked); |
54 CHROMEGTK_CALLBACK_0(AvatarMenuBubbleGtk, void, OnRealize); | |
55 | 54 |
56 // Create all widgets in this bubble. | 55 // Create all widgets in this bubble. |
57 void InitContents(); | 56 void InitContents(); |
58 | 57 |
59 // Create the menu contents for a normal profile. | 58 // Create the menu contents for a normal profile. |
60 void InitMenuContents(); | 59 void InitMenuContents(); |
61 | 60 |
62 // Create the managed user specific contents of the menu. | 61 // Create the managed user specific contents of the menu. |
63 void InitManagedUserContents(); | 62 void InitManagedUserContents(); |
64 | 63 |
65 // Close the bubble and set bubble_ to NULL. | 64 // Close the bubble and set bubble_ to NULL. |
66 void CloseBubble(); | 65 void CloseBubble(); |
67 | 66 |
68 // A model of all the profile information to be displayed in the menu. | 67 // A model of all the profile information to be displayed in the menu. |
69 scoped_ptr<AvatarMenuModel> avatar_menu_model_; | 68 scoped_ptr<AvatarMenuModel> avatar_menu_model_; |
70 | 69 |
71 // A weak pointer to the parent widget of all widgets in the bubble. | 70 // A weak pointer to the parent widget of all widgets in the bubble. |
72 GtkWidget* contents_; | 71 GtkWidget* contents_; |
73 | 72 |
74 // A weak pointer to the only child widget of |contents_| which contains all | 73 // A weak pointer to the only child widget of |contents_| which contains all |
75 // widgets in the bubble. | 74 // widgets in the bubble. |
76 GtkWidget* inner_contents_; | 75 GtkWidget* inner_contents_; |
77 | 76 |
78 // A weak pointer to the GtkTextView which holds general information about | |
79 // managed users. | |
80 GtkWidget* managed_user_info_; | |
81 | |
82 // A weak pointer to the bubble window. | 77 // A weak pointer to the bubble window. |
83 BubbleGtk* bubble_; | 78 BubbleGtk* bubble_; |
84 | 79 |
85 // A weak pointer to the theme service. | 80 // A weak pointer to the theme service. |
86 GtkThemeService* theme_service_; | 81 GtkThemeService* theme_service_; |
87 | 82 |
88 // A weak pointer to the new profile link to keep its theme information | 83 // A weak pointer to the new profile link to keep its theme information |
89 // updated. | 84 // updated. |
90 GtkWidget* new_profile_link_; | 85 GtkWidget* new_profile_link_; |
91 | 86 |
92 // A vector of all profile items in the menu. | 87 // A vector of all profile items in the menu. |
93 ScopedVector<AvatarMenuItemGtk> items_; | 88 ScopedVector<AvatarMenuItemGtk> items_; |
94 | 89 |
95 // The minimum width to display the bubble. This is used to prevent the bubble | 90 // The minimum width to display the bubble. This is used to prevent the bubble |
96 // from automatically reducing its size when hovering over a profile item. | 91 // from automatically reducing its size when hovering over a profile item. |
97 int minimum_width_; | 92 int minimum_width_; |
98 | 93 |
99 // Is set to true if the managed user has clicked on Switch Users. | 94 // Is set to true if the managed user has clicked on Switch Users. |
100 bool switching_; | 95 bool switching_; |
101 | 96 |
102 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleGtk); | 97 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleGtk); |
103 }; | 98 }; |
104 | 99 |
105 #endif // CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUBBLE_GTK_H_ | 100 #endif // CHROME_BROWSER_UI_GTK_AVATAR_MENU_BUBBLE_GTK_H_ |
OLD | NEW |