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

Unified Diff: chrome/browser/ui/gtk/avatar_menu_button_gtk.cc

Issue 9500003: Add a button to exit managed mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698