Index: chrome/browser/ui/views/profiles/profile_chooser_view.h |
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.h b/chrome/browser/ui/views/profiles/profile_chooser_view.h |
index ee82dab69acd8e2ab4aa6f981c618c0815172c4a..f77023c950ebf7287a87ee3a072d71b7de7270b7 100644 |
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.h |
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.h |
@@ -21,6 +21,7 @@ |
#include "google_apis/gaia/oauth2_token_service.h" |
#include "ui/views/bubble/bubble_dialog_delegate.h" |
#include "ui/views/controls/button/button.h" |
+#include "ui/views/controls/button/menu_button.h" |
#include "ui/views/controls/link_listener.h" |
#include "ui/views/controls/styled_label_listener.h" |
@@ -53,12 +54,16 @@ class ProfileChooserView : public content::WebContentsDelegate, |
profiles::TutorialMode tutorial_mode, |
const signin::ManageAccountsParams& manage_accounts_params, |
signin_metrics::AccessPoint access_point, |
- views::View* anchor_view, |
+ views::MenuButton* calling_button, |
Browser* browser, |
bool is_source_keyboard); |
static bool IsShowing(); |
static void Hide(); |
+ // Make calling_button look pressed and animate the ink drop on it. |
+ // The event (click) is used to center the ink drop. |
+ static void MakeCallingButtonPressedIfShowing(const ui::Event* click_event); |
+ |
const Browser* browser() const { return browser_; } |
private: |
@@ -68,7 +73,7 @@ class ProfileChooserView : public content::WebContentsDelegate, |
typedef std::map<views::Button*, int> ButtonIndexes; |
typedef std::map<views::Button*, std::string> AccountButtonIndexes; |
- ProfileChooserView(views::View* anchor_view, |
+ ProfileChooserView(views::MenuButton* calling_button, |
Browser* browser, |
profiles::BubbleViewMode view_mode, |
profiles::TutorialMode tutorial_mode, |
@@ -76,6 +81,8 @@ class ProfileChooserView : public content::WebContentsDelegate, |
signin_metrics::AccessPoint access_point); |
~ProfileChooserView() override; |
+ void MakeCallingButtonPressed(const ui::Event* click_event); |
+ |
// views::BubbleDialogDelegateView: |
void Init() override; |
void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override; |
@@ -200,6 +207,10 @@ class ProfileChooserView : public content::WebContentsDelegate, |
// Clean-up done after an action was performed in the ProfileChooser. |
void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed); |
+ // Avatar button pressed to show this menu and the lock to keep it "pressed" |
+ views::MenuButton* calling_button_; |
+ std::unique_ptr<views::MenuButton::PressedLock> pressed_lock_; |
+ |
std::unique_ptr<AvatarMenu> avatar_menu_; |
Browser* browser_; |