Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "chrome/browser/profiles/avatar_menu_model_observer.h" | |
| 12 #include "chrome/browser/ui/views/bubble/bubble.h" | |
| 13 #include "views/controls/button/image_button.h" | |
| 14 | |
| 15 class AvatarMenuModel; | |
| 16 class Browser; | |
| 17 class EditUserButton; | |
| 18 | |
| 19 // This bubble view is displayed when the user clicks on the avatar button. | |
| 20 // It displays a list of profiles and allows users to switch between profiles. | |
| 21 class AvatarMenuBubbleView : public views::View, | |
| 22 public BubbleDelegate, | |
| 23 public views::ButtonListener, | |
| 24 public AvatarMenuModelObserver { | |
| 25 public: | |
| 26 explicit AvatarMenuBubbleView(Browser* browser); | |
| 27 ~AvatarMenuBubbleView(); | |
| 28 | |
| 29 // views::View implementation. | |
| 30 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 31 virtual void Layout() OVERRIDE; | |
| 32 | |
| 33 // views::ButtonListener implementation. | |
|
Peter Kasting
2011/08/05 18:08:33
Nit: List these groups in the same order as you ha
sail
2011/08/09 00:47:47
Done.
| |
| 34 virtual void ButtonPressed(views::Button* sender, | |
| 35 const views::Event& event) OVERRIDE; | |
| 36 | |
| 37 // BubbleDelegate implementation. | |
| 38 virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE; | |
| 39 virtual bool CloseOnEscape() OVERRIDE; | |
| 40 virtual bool FadeInOnShow() OVERRIDE; | |
| 41 | |
| 42 // AvatarMenuModelObserver implementation. | |
| 43 virtual void OnAvatarMenuModelChanged( | |
| 44 AvatarMenuModel* avatar_menu_model) OVERRIDE; | |
| 45 | |
| 46 private: | |
| 47 views::ImageButton* add_user_button_; | |
| 48 scoped_ptr<AvatarMenuModel> avatar_menu_model_; | |
| 49 Browser* browser_; | |
| 50 EditUserButton* edit_user_button_; | |
| 51 std::vector<views::ImageButton*> item_views_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); | |
| 54 }; | |
| 55 | |
| 56 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ | |
| OLD | NEW |