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_ITEM_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_AVATAR_MENU_ITEM_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_AVATAR_MENU_ITEM_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_AVATAR_MENU_ITEM_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "chrome/browser/profiles/avatar_menu_model.h" | 10 #include "chrome/browser/profiles/avatar_menu_model.h" |
11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
13 #include "ui/base/gtk/gtk_signal.h" | 13 #include "ui/base/gtk/gtk_signal.h" |
14 #include "ui/base/gtk/owned_widget_gtk.h" | 14 #include "ui/base/gtk/owned_widget_gtk.h" |
15 | 15 |
16 class GtkThemeService; | 16 class GtkThemeService; |
17 | 17 |
18 // This widget contains the profile icon, user name, and synchronization status | 18 // This widget contains the profile icon, user name, and synchronization status |
19 // to be displayed in the AvatarMenuBubble. Clicking the profile will open a new | 19 // to be displayed in the AvatarMenuBubble. Clicking the profile will open a new |
20 // browser window, and when the user hovers over an active profile item, a link | 20 // browser window, and when the user hovers over an active profile item, a link |
21 // is displayed that will allow editing the profile. | 21 // is displayed that will allow editing the profile. |
22 class AvatarMenuItemGtk : public content::NotificationObserver { | 22 class AvatarMenuItemGtk : public content::NotificationObserver { |
23 public: | 23 public: |
24 // Delegates opening or editing a profile. | 24 // Delegates opening or editing a profile. |
25 class Delegate { | 25 class Delegate { |
26 public: | 26 public: |
27 virtual ~Delegate() { } | |
28 | |
29 // Open a new browser window using the profile at |profile_index|. | 27 // Open a new browser window using the profile at |profile_index|. |
30 virtual void OpenProfile(size_t profile_index) = 0; | 28 virtual void OpenProfile(size_t profile_index) = 0; |
31 | 29 |
32 // Edit the profile given by |profile_index|. | 30 // Edit the profile given by |profile_index|. |
33 virtual void EditProfile(size_t profile_index) = 0; | 31 virtual void EditProfile(size_t profile_index) = 0; |
34 }; | 32 }; |
35 | 33 |
36 AvatarMenuItemGtk(Delegate* delegate, | 34 AvatarMenuItemGtk(Delegate* delegate, |
37 const AvatarMenuModel::Item& item, | 35 const AvatarMenuModel::Item& item, |
38 size_t item_index, | 36 size_t item_index, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // The unhighlighted color. Depending on the theme, this is either NULL or a | 105 // The unhighlighted color. Depending on the theme, this is either NULL or a |
108 // pointer to static data. | 106 // pointer to static data. |
109 const GdkColor* unhighlighted_color_; | 107 const GdkColor* unhighlighted_color_; |
110 | 108 |
111 content::NotificationRegistrar registrar_; | 109 content::NotificationRegistrar registrar_; |
112 | 110 |
113 DISALLOW_COPY_AND_ASSIGN(AvatarMenuItemGtk); | 111 DISALLOW_COPY_AND_ASSIGN(AvatarMenuItemGtk); |
114 }; | 112 }; |
115 | 113 |
116 #endif // CHROME_BROWSER_UI_GTK_AVATAR_MENU_ITEM_GTK_H_ | 114 #endif // CHROME_BROWSER_UI_GTK_AVATAR_MENU_ITEM_GTK_H_ |
OLD | NEW |