OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PROFILE_CHOOSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILE_CHOOSER_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PROFILE_CHOOSER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PROFILE_CHOOSER_VIEW_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 views::BubbleBorder::Arrow arrow, | 43 views::BubbleBorder::Arrow arrow, |
44 views::BubbleBorder::BubbleAlignment border_alignment, | 44 views::BubbleBorder::BubbleAlignment border_alignment, |
45 const gfx::Rect& anchor_rect, | 45 const gfx::Rect& anchor_rect, |
46 Browser* browser); | 46 Browser* browser); |
47 static bool IsShowing(); | 47 static bool IsShowing(); |
48 static void Hide(); | 48 static void Hide(); |
49 | 49 |
50 // We normally close the bubble any time it becomes inactive but this can lead | 50 // We normally close the bubble any time it becomes inactive but this can lead |
51 // to flaky tests where unexpected UI events are triggering this behavior. | 51 // to flaky tests where unexpected UI events are triggering this behavior. |
52 // Tests should call this with "false" for more consistent operation. | 52 // Tests should call this with "false" for more consistent operation. |
53 static void set_close_on_deactivate(bool close) { | 53 static void clear_close_on_deactivate_for_testing() { |
54 close_on_deactivate_ = close; | 54 close_on_deactivate_for_testing_ = false; |
55 } | 55 } |
56 | 56 |
57 private: | 57 private: |
58 friend class NewAvatarMenuButtonTest; | 58 friend class NewAvatarMenuButtonTest; |
59 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut); | 59 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut); |
60 | 60 |
61 typedef std::vector<size_t> Indexes; | 61 typedef std::vector<size_t> Indexes; |
62 typedef std::map<views::Button*, int> ButtonIndexes; | 62 typedef std::map<views::Button*, int> ButtonIndexes; |
63 | 63 |
64 // Different views that can be displayed in the bubble. | 64 // Different views that can be displayed in the bubble. |
(...skipping 17 matching lines...) Expand all Loading... |
82 virtual void ButtonPressed(views::Button* sender, | 82 virtual void ButtonPressed(views::Button* sender, |
83 const ui::Event& event) OVERRIDE; | 83 const ui::Event& event) OVERRIDE; |
84 | 84 |
85 // LinkListener: | 85 // LinkListener: |
86 virtual void LinkClicked(views::Link* sender, int event_flags) OVERRIDE; | 86 virtual void LinkClicked(views::Link* sender, int event_flags) OVERRIDE; |
87 | 87 |
88 // AvatarMenuObserver: | 88 // AvatarMenuObserver: |
89 virtual void OnAvatarMenuChanged(AvatarMenu* avatar_menu) OVERRIDE; | 89 virtual void OnAvatarMenuChanged(AvatarMenu* avatar_menu) OVERRIDE; |
90 | 90 |
91 static ProfileChooserView* profile_bubble_; | 91 static ProfileChooserView* profile_bubble_; |
92 static bool close_on_deactivate_; | 92 static bool close_on_deactivate_for_testing_; |
93 | 93 |
94 void ResetLinksAndButtons(); | 94 void ResetLinksAndButtons(); |
95 | 95 |
96 // Shows either the profile chooser or the account management views. | 96 // Shows either the profile chooser or the account management views. |
97 void ShowView(BubbleViewMode view_to_display, | 97 void ShowView(BubbleViewMode view_to_display, |
98 AvatarMenu* avatar_menu); | 98 AvatarMenu* avatar_menu); |
99 | 99 |
100 // Creates the main profile card for the profile |avatar_item|. |is_guest| | 100 // Creates the main profile card for the profile |avatar_item|. |is_guest| |
101 // is used to determine whether to show any Sign in/Sign out/Manage accounts | 101 // is used to determine whether to show any Sign in/Sign out/Manage accounts |
102 // links. | 102 // links. |
(...skipping 25 matching lines...) Expand all Loading... |
128 // Action buttons. | 128 // Action buttons. |
129 views::TextButton* guest_button_; | 129 views::TextButton* guest_button_; |
130 views::TextButton* end_guest_button_; | 130 views::TextButton* end_guest_button_; |
131 views::TextButton* add_user_button_; | 131 views::TextButton* add_user_button_; |
132 views::TextButton* users_button_; | 132 views::TextButton* users_button_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); | 134 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); |
135 }; | 135 }; |
136 | 136 |
137 #endif // CHROME_BROWSER_UI_VIEWS_PROFILE_CHOOSER_VIEW_H_ | 137 #endif // CHROME_BROWSER_UI_VIEWS_PROFILE_CHOOSER_VIEW_H_ |
OLD | NEW |