| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROFILES_AVATAR_MENU_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_MENU_BUBBLE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_MENU_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // If the bubble is already showing when the user clicks on the button then | 43 // If the bubble is already showing when the user clicks on the button then |
| 44 // this will cause two things to happen: | 44 // this will cause two things to happen: |
| 45 // - (1) the button will show a new instance of the bubble | 45 // - (1) the button will show a new instance of the bubble |
| 46 // - (2) the old instance of the bubble will get a deactivate event and | 46 // - (2) the old instance of the bubble will get a deactivate event and |
| 47 // close | 47 // close |
| 48 // To prevent this reshow this function checks if an instance of the bubble | 48 // To prevent this reshow this function checks if an instance of the bubble |
| 49 // is already showing and do nothing. This means that (1) will do nothing | 49 // is already showing and do nothing. This means that (1) will do nothing |
| 50 // and (2) will correctly hide the old bubble instance. | 50 // and (2) will correctly hide the old bubble instance. |
| 51 static void ShowBubble(views::View* anchor_view, | 51 static void ShowBubble(views::View* anchor_view, |
| 52 views::BubbleBorder::Arrow arrow, | 52 views::BubbleBorder::Arrow arrow, |
| 53 views::BubbleBorder::ArrowPaintType arrow_paint_type, |
| 53 views::BubbleBorder::BubbleAlignment border_alignment, | 54 views::BubbleBorder::BubbleAlignment border_alignment, |
| 54 const gfx::Rect& anchor_rect, | 55 const gfx::Rect& anchor_rect, |
| 55 Browser* browser); | 56 Browser* browser); |
| 56 static bool IsShowing(); | 57 static bool IsShowing(); |
| 57 static void Hide(); | 58 static void Hide(); |
| 58 | 59 |
| 59 virtual ~AvatarMenuBubbleView(); | 60 virtual ~AvatarMenuBubbleView(); |
| 60 | 61 |
| 61 // views::View implementation. | 62 // views::View implementation. |
| 62 virtual gfx::Size GetPreferredSize() OVERRIDE; | 63 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 static AvatarMenuBubbleView* avatar_bubble_; | 128 static AvatarMenuBubbleView* avatar_bubble_; |
| 128 static bool close_on_deactivate_for_testing_; | 129 static bool close_on_deactivate_for_testing_; |
| 129 | 130 |
| 130 // Is set to true if the managed user has clicked on Switch Users. | 131 // Is set to true if the managed user has clicked on Switch Users. |
| 131 bool expanded_; | 132 bool expanded_; |
| 132 | 133 |
| 133 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); | 134 DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_MENU_BUBBLE_VIEW_H_ | 137 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_AVATAR_MENU_BUBBLE_VIEW_H_ |
| OLD | NEW |