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

Unified Diff: ash/system/user/user_view.h

Issue 210903003: Implemented system tray UI for new account management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge conflicts resolved. Created 6 years, 8 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
« no previous file with comments | « ash/system/user/user_card_view.cc ('k') | ash/system/user/user_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/user/user_view.h
diff --git a/ash/system/user/user_view.h b/ash/system/user/user_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..e6657c6434dc04a6ec1966dcd48dfaf059ea3c44
--- /dev/null
+++ b/ash/system/user/user_view.h
@@ -0,0 +1,94 @@
+// Copyright 2014 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 ASH_SYSTEM_USER_USER_VIEW_H_
+#define ASH_SYSTEM_USER_USER_VIEW_H_
+
+#include "ash/session_state_delegate.h"
+#include "ash/system/tray/tray_constants.h"
+#include "ash/system/user/login_status.h"
+#include "ash/system/user/tray_user.h"
+#include "base/macros.h"
+#include "ui/views/controls/button/button.h"
+#include "ui/views/layout/box_layout.h"
+#include "ui/views/mouse_watcher.h"
+#include "ui/views/view.h"
+
+namespace gfx {
+class Rect;
+class Size;
+}
+
+namespace ash {
+
+class PopupMessage;
+class SystemTrayItem;
+
+namespace tray {
+
+// The view of a user item in system tray bubble.
+class UserView : public views::View,
+ public views::ButtonListener,
+ public views::MouseWatcherListener {
+ public:
+ UserView(SystemTrayItem* owner,
+ ash::user::LoginStatus login,
+ MultiProfileIndex index,
+ bool for_detailed_view);
+ virtual ~UserView();
+
+ // Overridden from MouseWatcherListener:
+ virtual void MouseMovedOutOfHost() OVERRIDE;
+
+ TrayUser::TestState GetStateForTest() const;
+ gfx::Rect GetBoundsInScreenOfUserButtonForTest();
+
+ private:
+ // Overridden from views::View.
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual int GetHeightForWidth(int width) OVERRIDE;
+ virtual void Layout() OVERRIDE;
+
+ // Overridden from views::ButtonListener.
+ virtual void ButtonPressed(views::Button* sender,
+ const ui::Event& event) OVERRIDE;
+
+ void AddLogoutButton(user::LoginStatus login);
+ void AddUserCard(user::LoginStatus login);
+
+ // Create the menu option to add another user. If |disabled| is set the user
+ // cannot actively click on the item.
+ void ToggleAddUserMenuOption();
+
+ MultiProfileIndex multiprofile_index_;
+ // The view of the user card.
+ views::View* user_card_view_;
+
+ // This is the owner system tray item of this view.
+ SystemTrayItem* owner_;
+
+ // True if |user_card_view_| is a |ButtonFromView| - otherwise it is only
+ // a |UserCardView|.
+ bool is_user_card_button_;
+
+ views::View* logout_button_;
+ scoped_ptr<PopupMessage> popup_message_;
+ scoped_ptr<views::Widget> add_menu_option_;
+
+ // True when the add user panel is visible but not activatable.
+ bool add_user_disabled_;
+
+ // True if this view will be used inside detailed view.
+ bool for_detailed_view_;
+
+ // The mouse watcher which takes care of out of window hover events.
+ scoped_ptr<views::MouseWatcher> mouse_watcher_;
+
+ DISALLOW_COPY_AND_ASSIGN(UserView);
+};
+
+} // namespace tray
+} // namespace ash
+
+#endif // ASH_SYSTEM_USER_USER_VIEW_H_
« no previous file with comments | « ash/system/user/user_card_view.cc ('k') | ash/system/user/user_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698