Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: chrome/browser/ui/views/avatar_menu_bubble_view.h

Issue 8621004: Revert 111018 - Rebase AvatarMenuBubbleView on the new views bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/avatar_menu_bubble_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "chrome/browser/profiles/avatar_menu_model_observer.h" 13 #include "chrome/browser/profiles/avatar_menu_model_observer.h"
14 #include "ui/views/bubble/bubble_delegate.h" 14 #include "chrome/browser/ui/views/bubble/bubble.h"
15 #include "views/controls/button/button.h" 15 #include "views/controls/button/button.h"
16 #include "views/controls/link_listener.h" 16 #include "views/controls/link_listener.h"
17 17
18 class AvatarMenuModel; 18 class AvatarMenuModel;
19 class Browser; 19 class Browser;
20 20
21 namespace views { 21 namespace views {
22 class CustomButton; 22 class CustomButton;
23 class Link; 23 class Link;
24 class Separator; 24 class Separator;
25 } 25 }
26 26
27 // This bubble view is displayed when the user clicks on the avatar button. 27 // This bubble view is displayed when the user clicks on the avatar button.
28 // It displays a list of profiles and allows users to switch between profiles. 28 // It displays a list of profiles and allows users to switch between profiles.
29 class AvatarMenuBubbleView : public views::BubbleDelegateView, 29 class AvatarMenuBubbleView : public views::View,
30 public views::ButtonListener, 30 public views::ButtonListener,
31 public views::LinkListener, 31 public views::LinkListener,
32 public BubbleDelegate,
32 public AvatarMenuModelObserver { 33 public AvatarMenuModelObserver {
33 public: 34 public:
34 AvatarMenuBubbleView(views::View* anchor_view, 35 explicit AvatarMenuBubbleView(Browser* browser);
35 views::BubbleBorder::ArrowLocation arrow_location,
36 const gfx::Rect& anchor_rect,
37 Browser* browser);
38 virtual ~AvatarMenuBubbleView(); 36 virtual ~AvatarMenuBubbleView();
39 37
40 // views::View implementation. 38 // views::View implementation.
41 virtual gfx::Size GetPreferredSize() OVERRIDE; 39 virtual gfx::Size GetPreferredSize() OVERRIDE;
42 virtual void Layout() OVERRIDE; 40 virtual void Layout() OVERRIDE;
43 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; 41 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
44 42
45 // views::ButtonListener implementation. 43 // views::ButtonListener implementation.
46 virtual void ButtonPressed(views::Button* sender, 44 virtual void ButtonPressed(views::Button* sender,
47 const views::Event& event) OVERRIDE; 45 const views::Event& event) OVERRIDE;
48 46
49 // views::LinkListener implementation. 47 // views::LinkListener implementation.
50 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; 48 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
51 49
52 // BubbleDelegate implementation. 50 // BubbleDelegate implementation.
53 virtual gfx::Point GetAnchorPoint() OVERRIDE; 51 virtual void BubbleShown() OVERRIDE;
54 virtual void Init() OVERRIDE; 52 virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE;
53 virtual bool CloseOnEscape() OVERRIDE;
54 virtual bool FadeInOnShow() OVERRIDE;
55 55
56 // AvatarMenuModelObserver implementation. 56 // AvatarMenuModelObserver implementation.
57 virtual void OnAvatarMenuModelChanged( 57 virtual void OnAvatarMenuModelChanged(
58 AvatarMenuModel* avatar_menu_model) OVERRIDE; 58 AvatarMenuModel* avatar_menu_model) OVERRIDE;
59 59
60 private: 60 private:
61 views::Link* add_profile_link_; 61 views::Link* add_profile_link_;
62 scoped_ptr<AvatarMenuModel> avatar_menu_model_; 62 scoped_ptr<AvatarMenuModel> avatar_menu_model_;
63 gfx::Rect anchor_rect_;
64 Browser* browser_; 63 Browser* browser_;
65 std::vector<views::CustomButton*> item_views_; 64 std::vector<views::CustomButton*> item_views_;
66 views::Separator* separator_; 65 views::Separator* separator_;
67 66
68 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); 67 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView);
69 }; 68 };
70 69
71 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ 70 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/avatar_menu_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698