| Index: chrome/browser/ui/gtk/avatar_menu_button_gtk.cc
|
| diff --git a/chrome/browser/ui/gtk/avatar_menu_button_gtk.cc b/chrome/browser/ui/gtk/avatar_menu_button_gtk.cc
|
| index 411f721afde9d7ed30807b71061684389adde246..c6ebbb127949f41c394adfca2984a3a6d3c75491 100644
|
| --- a/chrome/browser/ui/gtk/avatar_menu_button_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/avatar_menu_button_gtk.cc
|
| @@ -5,8 +5,12 @@
|
| #include "chrome/browser/ui/gtk/avatar_menu_button_gtk.h"
|
|
|
| #include "base/i18n/rtl.h"
|
| +#include "chrome/app/chrome_command_ids.h"
|
| +#include "chrome/browser/command_updater.h"
|
| +#include "chrome/browser/managed_mode.h"
|
| #include "chrome/browser/profiles/profile_metrics.h"
|
| #include "chrome/browser/profiles/profile_info_util.h"
|
| +#include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/gtk/avatar_menu_bubble_gtk.h"
|
| #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
|
| #include "ui/gfx/gtk_util.h"
|
| @@ -46,6 +50,11 @@ gboolean AvatarMenuButtonGtk::OnButtonPressed(GtkWidget* widget,
|
| if (event->button != 1)
|
| return FALSE;
|
|
|
| + if (ManagedMode::IsInManagedMode()) {
|
| + ManagedMode::LeaveManagedMode();
|
| + return TRUE;
|
| + }
|
| +
|
| ShowAvatarBubble();
|
| ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
|
| return TRUE;
|
| @@ -58,6 +67,7 @@ void AvatarMenuButtonGtk::OnSizeAllocate(GtkWidget* widget,
|
| }
|
|
|
| void AvatarMenuButtonGtk::ShowAvatarBubble() {
|
| + DCHECK(browser_->command_updater()->IsCommandEnabled(IDC_SHOW_AVATAR_MENU));
|
| // Only show the avatar bubble if the avatar button is in the title bar.
|
| if (gtk_widget_get_parent_window(widget_.get()))
|
| new AvatarMenuBubbleGtk(browser_, widget_.get(), arrow_location_, NULL);
|
|
|