| Index: chrome/browser/ui/views/profiles/new_avatar_button.cc
|
| diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.cc b/chrome/browser/ui/views/profiles/new_avatar_button.cc
|
| index 99a62030508db329d3e8417a9fcc0b35cf0dbeee..2fe40aeee147f1612ef61422bf167076532527ee 100644
|
| --- a/chrome/browser/ui/views/profiles/new_avatar_button.cc
|
| +++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc
|
| @@ -9,6 +9,7 @@
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/profiles/profiles_state.h"
|
| #include "chrome/browser/ui/browser.h"
|
| +#include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
|
| #include "grit/theme_resources.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| #include "ui/gfx/canvas.h"
|
| @@ -50,7 +51,8 @@ NewAvatarButton::NewAvatarButton(
|
| profiles::GetAvatarButtonTextForProfile(browser->profile()),
|
| NULL,
|
| true),
|
| - browser_(browser) {
|
| + browser_(browser),
|
| + suppress_mouse_released_action_(false) {
|
| set_animate_on_state_change(false);
|
| SetTextColor(views::Button::STATE_NORMAL, SK_ColorWHITE);
|
| SetTextColor(views::Button::STATE_HOVERED, SK_ColorWHITE);
|
| @@ -111,6 +113,19 @@ NewAvatarButton::~NewAvatarButton() {
|
| error->RemoveObserver(this);
|
| }
|
|
|
| +bool NewAvatarButton::OnMousePressed(const ui::MouseEvent& event) {
|
| + // Prevent the bubble from being re-shown if it's already showing.
|
| + suppress_mouse_released_action_ = ProfileChooserView::IsShowing();
|
| + return MenuButton::OnMousePressed(event);
|
| +}
|
| +
|
| +void NewAvatarButton::OnMouseReleased(const ui::MouseEvent& event) {
|
| + if (suppress_mouse_released_action_)
|
| + suppress_mouse_released_action_ = false;
|
| + else
|
| + MenuButton::OnMouseReleased(event);
|
| +}
|
| +
|
| void NewAvatarButton::OnProfileAdded(const base::FilePath& profile_path) {
|
| UpdateAvatarButtonAndRelayoutParent();
|
| }
|
|
|