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_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/profiles/avatar_menu_model_observer.h" | 11 #include "chrome/browser/profiles/avatar_menu_model_observer.h" |
12 #include "chrome/browser/ui/views/bubble/bubble.h" | 12 #include "chrome/browser/ui/views/bubble/bubble.h" |
13 #include "views/controls/button/custom_button.h" | 13 #include "views/controls/button/custom_button.h" |
14 #include "views/controls/link.h" | 14 #include "views/controls/link.h" |
15 #include "views/controls/link_listener.h" | 15 #include "views/controls/link_listener.h" |
16 | 16 |
17 class AvatarMenuModel; | 17 class AvatarMenuModel; |
18 class Browser; | 18 class Browser; |
19 class EditProfileButton; | 19 class EditProfileButton; |
20 | 20 |
21 // This bubble view is displayed when the user clicks on the avatar button. | 21 // This bubble view is displayed when the user clicks on the avatar button. |
22 // It displays a list of profiles and allows users to switch between profiles. | 22 // It displays a list of profiles and allows users to switch between profiles. |
23 class AvatarMenuBubbleView : public views::View, | 23 class AvatarMenuBubbleView : public views::View, |
24 public views::ButtonListener, | 24 public views::ButtonListener, |
25 public views::LinkListener, | 25 public views::LinkListener, |
26 public BubbleDelegate, | 26 public BubbleDelegate, |
27 public AvatarMenuModelObserver { | 27 public AvatarMenuModelObserver { |
28 public: | 28 public: |
29 explicit AvatarMenuBubbleView(Browser* browser); | 29 explicit AvatarMenuBubbleView(Browser* browser); |
30 ~AvatarMenuBubbleView(); | 30 virtual ~AvatarMenuBubbleView(); |
31 | 31 |
32 // views::View implementation. | 32 // views::View implementation. |
33 virtual gfx::Size GetPreferredSize() OVERRIDE; | 33 virtual gfx::Size GetPreferredSize() OVERRIDE; |
34 virtual void Layout() OVERRIDE; | 34 virtual void Layout() OVERRIDE; |
35 | 35 |
36 // views::ButtonListener implementation. | 36 // views::ButtonListener implementation. |
37 virtual void ButtonPressed(views::Button* sender, | 37 virtual void ButtonPressed(views::Button* sender, |
38 const views::Event& event) OVERRIDE; | 38 const views::Event& event) OVERRIDE; |
39 | 39 |
40 // views::LinkListener implementation. | 40 // views::LinkListener implementation. |
(...skipping 12 matching lines...) Expand all Loading... |
53 views::Link* add_profile_link_; | 53 views::Link* add_profile_link_; |
54 scoped_ptr<AvatarMenuModel> avatar_menu_model_; | 54 scoped_ptr<AvatarMenuModel> avatar_menu_model_; |
55 Browser* browser_; | 55 Browser* browser_; |
56 EditProfileButton* edit_profile_button_; | 56 EditProfileButton* edit_profile_button_; |
57 std::vector<views::CustomButton*> item_views_; | 57 std::vector<views::CustomButton*> item_views_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); | 59 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); |
60 }; | 60 }; |
61 | 61 |
62 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ | 62 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ |
OLD | NEW |