Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view.h

Issue 333353004: Fix the Windows 8 mode avatar button menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use another ProfileChooserView anchor, remove unused anchor_rect. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_PROFILE_CHOOSER_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // Shows the bubble if one is not already showing. This allows us to easily 49 // Shows the bubble if one is not already showing. This allows us to easily
50 // make a button toggle the bubble on and off when clicked: we unconditionally 50 // make a button toggle the bubble on and off when clicked: we unconditionally
51 // call this function when the button is clicked and if the bubble isn't 51 // call this function when the button is clicked and if the bubble isn't
52 // showing it will appear while if it is showing, nothing will happen here and 52 // showing it will appear while if it is showing, nothing will happen here and
53 // the existing bubble will auto-close due to focus loss. 53 // the existing bubble will auto-close due to focus loss.
54 static void ShowBubble(profiles::BubbleViewMode view_mode, 54 static void ShowBubble(profiles::BubbleViewMode view_mode,
55 signin::GAIAServiceType service_type, 55 signin::GAIAServiceType service_type,
56 views::View* anchor_view, 56 views::View* anchor_view,
57 views::BubbleBorder::Arrow arrow, 57 views::BubbleBorder::Arrow arrow,
58 views::BubbleBorder::BubbleAlignment border_alignment, 58 views::BubbleBorder::BubbleAlignment border_alignment,
59 const gfx::Rect& anchor_rect,
60 Browser* browser); 59 Browser* browser);
61 static bool IsShowing(); 60 static bool IsShowing();
62 static void Hide(); 61 static void Hide();
63 62
64 // We normally close the bubble any time it becomes inactive but this can lead 63 // We normally close the bubble any time it becomes inactive but this can lead
65 // to flaky tests where unexpected UI events are triggering this behavior. 64 // to flaky tests where unexpected UI events are triggering this behavior.
66 // Tests should call this with "false" for more consistent operation. 65 // Tests should call this with "false" for more consistent operation.
67 static void clear_close_on_deactivate_for_testing() { 66 static void clear_close_on_deactivate_for_testing() {
68 close_on_deactivate_for_testing_ = false; 67 close_on_deactivate_for_testing_ = false;
69 } 68 }
70 69
71 private: 70 private:
72 friend class NewAvatarMenuButtonTest; 71 friend class NewAvatarMenuButtonTest;
73 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut); 72 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut);
74 73
75 typedef std::vector<size_t> Indexes; 74 typedef std::vector<size_t> Indexes;
76 typedef std::map<views::Button*, int> ButtonIndexes; 75 typedef std::map<views::Button*, int> ButtonIndexes;
77 typedef std::map<views::Button*, std::string> AccountButtonIndexes; 76 typedef std::map<views::Button*, std::string> AccountButtonIndexes;
78 77
79 ProfileChooserView(views::View* anchor_view, 78 ProfileChooserView(views::View* anchor_view,
80 views::BubbleBorder::Arrow arrow, 79 views::BubbleBorder::Arrow arrow,
81 const gfx::Rect& anchor_rect,
82 Browser* browser, 80 Browser* browser,
83 profiles::BubbleViewMode view_mode, 81 profiles::BubbleViewMode view_mode,
84 signin::GAIAServiceType service_type); 82 signin::GAIAServiceType service_type);
85 virtual ~ProfileChooserView(); 83 virtual ~ProfileChooserView();
86 84
87 // views::BubbleDelegateView: 85 // views::BubbleDelegateView:
88 virtual void Init() OVERRIDE; 86 virtual void Init() OVERRIDE;
89 virtual void WindowClosing() OVERRIDE; 87 virtual void WindowClosing() OVERRIDE;
90 88
91 // views::ButtonListener: 89 // views::ButtonListener:
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // The current tutorial mode. 237 // The current tutorial mode.
240 profiles::TutorialMode tutorial_mode_; 238 profiles::TutorialMode tutorial_mode_;
241 239
242 // The GAIA service type provided in the response header. 240 // The GAIA service type provided in the response header.
243 signin::GAIAServiceType gaia_service_type_; 241 signin::GAIAServiceType gaia_service_type_;
244 242
245 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); 243 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView);
246 }; 244 };
247 245
248 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ 246 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/profiles/profile_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698