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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 virtual void Init() OVERRIDE; | 75 virtual void Init() OVERRIDE; |
76 virtual void WindowClosing() OVERRIDE; | 76 virtual void WindowClosing() OVERRIDE; |
77 | 77 |
78 // AvatarMenuObserver implementation. | 78 // AvatarMenuObserver implementation. |
79 virtual void OnAvatarMenuChanged( | 79 virtual void OnAvatarMenuChanged( |
80 AvatarMenu* avatar_menu) OVERRIDE; | 80 AvatarMenu* avatar_menu) OVERRIDE; |
81 | 81 |
82 // We normally close the bubble any time it becomes inactive but this can lead | 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. | 83 // to flaky tests where unexpected UI events are triggering this behavior. |
84 // Tests should call this with "false" for more consistent operation. | 84 // Tests should call this with "false" for more consistent operation. |
85 static void set_close_on_deactivate(bool close) { | 85 static void set_close_on_deactivate_for_testing(bool close) { |
Peter Kasting
2013/11/04 22:19:33
If these functions are only for tests, and only ca
yao
2013/11/06 19:56:53
Done.
| |
86 close_on_deactivate_ = close; | 86 close_on_deactivate_for_testing_ = close; |
87 } | 87 } |
88 | 88 |
89 private: | 89 private: |
90 AvatarMenuBubbleView(views::View* anchor_view, | 90 AvatarMenuBubbleView(views::View* anchor_view, |
91 views::BubbleBorder::Arrow arrow, | 91 views::BubbleBorder::Arrow arrow, |
92 const gfx::Rect& anchor_rect, | 92 const gfx::Rect& anchor_rect, |
93 Browser* browser); | 93 Browser* browser); |
94 | 94 |
95 // Sets the colors on all the |item_views_|. Called after the | 95 // Sets the colors on all the |item_views_|. Called after the |
96 // BubbleDelegateView is created and has loaded the colors from the | 96 // BubbleDelegateView is created and has loaded the colors from the |
(...skipping 21 matching lines...) Expand all Loading... | |
118 | 118 |
119 // 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 |
120 // avatar_menu_->GetManagedUserInformation() returns a non-empty string. | 120 // avatar_menu_->GetManagedUserInformation() returns a non-empty string. |
121 // See OnAvatarMenuChanged(). | 121 // See OnAvatarMenuChanged(). |
122 views::Label* managed_user_info_; | 122 views::Label* managed_user_info_; |
123 views::ImageView* icon_view_; | 123 views::ImageView* icon_view_; |
124 views::Separator* separator_switch_users_; | 124 views::Separator* separator_switch_users_; |
125 views::Link* switch_profile_link_; | 125 views::Link* switch_profile_link_; |
126 | 126 |
127 static AvatarMenuBubbleView* avatar_bubble_; | 127 static AvatarMenuBubbleView* avatar_bubble_; |
128 static bool close_on_deactivate_; | 128 static bool close_on_deactivate_for_testing_; |
129 | 129 |
130 // 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. |
131 bool expanded_; | 131 bool expanded_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); | 133 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); |
134 }; | 134 }; |
135 | 135 |
136 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ | 136 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ |
OLD | NEW |