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

Unified Diff: chrome/browser/ui/views/avatar_menu_bubble_view.h

Issue 7566050: Multi-Profiles: Change avatar menu to bubble view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/avatar_menu_bubble_view.h
diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.h b/chrome/browser/ui/views/avatar_menu_bubble_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..25ef27b51f9c87d4566008578688a77c2297285f
--- /dev/null
+++ b/chrome/browser/ui/views/avatar_menu_bubble_view.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_
+#pragma once
+
+#include <vector>
+
+#include "chrome/browser/profiles/avatar_menu_model_observer.h"
+#include "chrome/browser/ui/views/bubble/bubble.h"
+#include "views/controls/button/image_button.h"
+
+class AvatarMenuModel;
+class Browser;
+class EditUserButton;
+
+// This bubble view is displayed when the user clicks on the avatar button.
+// It displays a list of profiles and allows users to switch between profiles.
+class AvatarMenuBubbleView : public views::View,
+ public BubbleDelegate,
+ public views::ButtonListener,
+ public AvatarMenuModelObserver {
+ public:
+ explicit AvatarMenuBubbleView(Browser* browser);
+ ~AvatarMenuBubbleView();
+
+ // views::View implementation.
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual void Layout() OVERRIDE;
+
+ // 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.
+ virtual void ButtonPressed(views::Button* sender,
+ const views::Event& event) OVERRIDE;
+
+ // BubbleDelegate implementation.
+ virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE;
+ virtual bool CloseOnEscape() OVERRIDE;
+ virtual bool FadeInOnShow() OVERRIDE;
+
+ // AvatarMenuModelObserver implementation.
+ virtual void OnAvatarMenuModelChanged(
+ AvatarMenuModel* avatar_menu_model) OVERRIDE;
+
+ private:
+ views::ImageButton* add_user_button_;
+ scoped_ptr<AvatarMenuModel> avatar_menu_model_;
+ Browser* browser_;
+ EditUserButton* edit_user_button_;
+ std::vector<views::ImageButton*> item_views_;
+
+ DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698