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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 15932008: Add managed user avatar menu for mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index c17c34d79d1bce4175d7df18a644027493ccdfcf..f630c561306e8e4332d9bb71f32ba1f0cb58edeb 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -18,6 +18,7 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/devtools/devtools_window.h"
+#include "chrome/browser/managed_mode/managed_user_service.h"
#include "chrome/browser/profiles/avatar_menu_model.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
@@ -80,6 +81,7 @@
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/gfx/mac/scoped_ns_disable_screen_updates.h"
+
Robert Sesek 2013/06/04 20:59:10 nit: extra blank line
Adrian Kuegel 2013/06/05 16:01:38 Removed.
using l10n_util::GetStringUTF16;
using l10n_util::GetNSStringWithFixup;
using l10n_util::GetNSStringFWithFixup;
@@ -1625,6 +1627,8 @@ enum {
// TODO(dmaclach): Instead of redrawing the whole window, views that care
// about the active window state should be registering for notifications.
[[self window] setViewsNeedDisplay:YES];
+ if (avatarButtonController_.get())
+ [avatarButtonController_ updateColors:[self themeProvider]];
}
- (ui::ThemeProvider*)themeProvider {
@@ -1726,6 +1730,16 @@ enum {
// image to display based on the browser.
avatarButtonController_.reset(
[[AvatarButtonController alloc] initWithBrowser:browser_.get()]);
+ if ([avatarButtonController_ labelView]) {
+ [avatarButtonController_ updateColors:[self themeProvider]];
+ NSTextField* label = [avatarButtonController_ labelView];
+ [label setNeedsDisplay:YES];
+ [label setHidden:![self shouldShowAvatar]];
+
+ // Install the view.
+ [[[[self window] contentView] superview] addSubview:label];
Robert Sesek 2013/06/04 20:59:10 Why not just have this be in the view that AvatarB
Adrian Kuegel 2013/06/05 16:01:38 Done.
Robert Sesek 2013/06/05 20:59:17 Not sure this was actually done.
Adrian Kuegel 2013/06/07 15:31:26 Yes, you are right, this was not working so far. T
+ }
+
NSView* view = [avatarButtonController_ view];
[view setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin];
[view setHidden:![self shouldShowAvatar]];

Powered by Google App Engine
This is Rietveld 408576698