| OLD | NEW |
| 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 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // BubbleDelegate implementation. | 73 // BubbleDelegate implementation. |
| 74 virtual gfx::Rect GetAnchorRect() OVERRIDE; | 74 virtual gfx::Rect GetAnchorRect() OVERRIDE; |
| 75 virtual void Init() OVERRIDE; | 75 virtual void Init() OVERRIDE; |
| 76 virtual void WindowClosing() OVERRIDE; | 76 virtual void WindowClosing() OVERRIDE; |
| 77 | 77 |
| 78 // AvatarMenuModelObserver implementation. | 78 // AvatarMenuModelObserver implementation. |
| 79 virtual void OnAvatarMenuModelChanged( | 79 virtual void OnAvatarMenuModelChanged( |
| 80 AvatarMenuModel* avatar_menu_model) OVERRIDE; | 80 AvatarMenuModel* avatar_menu_model) OVERRIDE; |
| 81 | 81 |
| 82 // We normally close the bubble any time it becomes inactive but this can lead |
| 83 // to flaky tests where unexpected UI events are triggering this behavior. |
| 84 // Tests should call this with "false" for more consistent operation. |
| 85 static void set_close_on_deactiavte(bool close) { |
| 86 close_on_deactivate_ = close; |
| 87 } |
| 88 |
| 82 private: | 89 private: |
| 83 AvatarMenuBubbleView(views::View* anchor_view, | 90 AvatarMenuBubbleView(views::View* anchor_view, |
| 84 views::BubbleBorder::Arrow arrow, | 91 views::BubbleBorder::Arrow arrow, |
| 85 const gfx::Rect& anchor_rect, | 92 const gfx::Rect& anchor_rect, |
| 86 Browser* browser); | 93 Browser* browser); |
| 87 | 94 |
| 88 // Sets the colors on all the |item_views_|. Called after the | 95 // Sets the colors on all the |item_views_|. Called after the |
| 89 // BubbleDelegateView is created and has loaded the colors from the | 96 // BubbleDelegateView is created and has loaded the colors from the |
| 90 // NativeTheme. | 97 // NativeTheme. |
| 91 void SetBackgroundColors(); | 98 void SetBackgroundColors(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 111 | 118 |
| 112 // This will be non-NULL if and only if |expanded_| is false and | 119 // This will be non-NULL if and only if |expanded_| is false and |
| 113 // avatar_menu_model_->GetManagedUserInformation() returns a non-empty string. | 120 // avatar_menu_model_->GetManagedUserInformation() returns a non-empty string. |
| 114 // See OnAvatarMenuModelChanged(). | 121 // See OnAvatarMenuModelChanged(). |
| 115 views::Label* managed_user_info_; | 122 views::Label* managed_user_info_; |
| 116 views::ImageView* icon_view_; | 123 views::ImageView* icon_view_; |
| 117 views::Separator* separator_switch_users_; | 124 views::Separator* separator_switch_users_; |
| 118 views::Link* switch_profile_link_; | 125 views::Link* switch_profile_link_; |
| 119 | 126 |
| 120 static AvatarMenuBubbleView* avatar_bubble_; | 127 static AvatarMenuBubbleView* avatar_bubble_; |
| 128 static bool close_on_deactivate_; |
| 121 | 129 |
| 122 // Is set to true if the managed user has clicked on Switch Users. | 130 // Is set to true if the managed user has clicked on Switch Users. |
| 123 bool expanded_; | 131 bool expanded_; |
| 124 | 132 |
| 125 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); | 133 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); |
| 126 FRIEND_TEST_ALL_PREFIXES(AvatarMenuButtonTest, SignOut); | 134 FRIEND_TEST_ALL_PREFIXES(AvatarMenuButtonTest, SignOut); |
| 127 }; | 135 }; |
| 128 | 136 |
| 129 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ | 137 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ |
| OLD | NEW |