Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / ash / system / user / user_view.h
index e1dc65a..774213e 100644 (file)
@@ -11,6 +11,7 @@
 #include "ash/system/user/tray_user.h"
 #include "base/macros.h"
 #include "ui/views/controls/button/button.h"
+#include "ui/views/focus/focus_manager.h"
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/mouse_watcher.h"
 #include "ui/views/view.h"
@@ -20,6 +21,10 @@ class Rect;
 class Size;
 }
 
+namespace views {
+class FocusManager;
+}
+
 namespace ash {
 
 class PopupMessage;
@@ -30,7 +35,8 @@ namespace tray {
 // The view of a user item in system tray bubble.
 class UserView : public views::View,
                  public views::ButtonListener,
-                 public views::MouseWatcherListener {
+                 public views::MouseWatcherListener,
+                 public views::FocusChangeListener {
  public:
   UserView(SystemTrayItem* owner,
            ash::user::LoginStatus login,
@@ -54,6 +60,12 @@ class UserView : public views::View,
   virtual void ButtonPressed(views::Button* sender,
                              const ui::Event& event) OVERRIDE;
 
+  // Overridden from views::FocusChangeListener:
+  virtual void OnWillChangeFocus(View* focused_before,
+                                 View* focused_now) OVERRIDE;
+  virtual void OnDidChangeFocus(View* focused_before,
+                                View* focused_now) OVERRIDE;
+
   void AddLogoutButton(user::LoginStatus login);
   void AddUserCard(user::LoginStatus login);
 
@@ -61,6 +73,9 @@ class UserView : public views::View,
   // cannot actively click on the item.
   void ToggleAddUserMenuOption();
 
+  // Removes the add user menu option.
+  void RemoveAddUserMenuOption();
+
   MultiProfileIndex multiprofile_index_;
   // The view of the user card.
   views::View* user_card_view_;
@@ -85,6 +100,9 @@ class UserView : public views::View,
   // The mouse watcher which takes care of out of window hover events.
   scoped_ptr<views::MouseWatcher> mouse_watcher_;
 
+  // The focus manager which we use to detect focus changes.
+  views::FocusManager* focus_manager_;
+
   DISALLOW_COPY_AND_ASSIGN(UserView);
 };