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

Unified Diff: ui/app_list/cocoa/current_user_menu_item_view.mm

Issue 22268009: Move signin status and current user information into AppListModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implemented for mac Created 7 years, 4 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: ui/app_list/cocoa/current_user_menu_item_view.mm
diff --git a/ui/app_list/cocoa/current_user_menu_item_view.mm b/ui/app_list/cocoa/current_user_menu_item_view.mm
index 6aac34c6a997bfad59afb232f4427dfca3b5608e..0dd0622c170e1334a31b399a230c60fd079a7590 100644
--- a/ui/app_list/cocoa/current_user_menu_item_view.mm
+++ b/ui/app_list/cocoa/current_user_menu_item_view.mm
@@ -6,9 +6,7 @@
#include "base/logging.h"
tapted 2013/08/14 03:53:11 nit: I think this can go too, with the DCHECK bein
calamity 2013/08/14 09:19:00 Done.
#include "base/mac/scoped_nsobject.h"
-#include "base/strings/sys_string_conversions.h"
#include "grit/ui_resources.h"
-#include "ui/app_list/app_list_view_delegate.h"
#include "ui/base/resource/resource_bundle.h"
namespace {
@@ -22,14 +20,14 @@ const CGFloat kMenuLeftMargin = 3;
// Adds a text label in the custom view in the menu showing the current user.
- (NSTextField*)addLabelWithFrame:(NSPoint)origin
- labelText:(const string16&)labelText;
+ labelText:(const base::string16&)labelText;
@end
@implementation CurrentUserMenuItemView
-- (id)initWithDelegate:(app_list::AppListViewDelegate*)delegate {
- DCHECK(delegate);
+- (id)initWithCurrentUser:(const base::string16&)userName
+ userEmail:(const base::string16&)userEmail {
if ((self = [super initWithFrame:NSZeroRect])) {
NSImage* userImage = ui::ResourceBundle::GetSharedInstance().
GetNativeImageNamed(IDR_APP_LIST_USER_INDICATOR).AsNSImage();
@@ -43,12 +41,12 @@ const CGFloat kMenuLeftMargin = 3;
NSPoint labelOrigin = NSMakePoint(NSMaxX(imageRect), 0);
NSTextField* userField =
[self addLabelWithFrame:labelOrigin
- labelText:delegate->GetCurrentUserName()];
+ labelText:userName];
labelOrigin.y = NSMaxY([userField frame]);
NSTextField* emailField =
[self addLabelWithFrame:labelOrigin
- labelText:delegate->GetCurrentUserEmail()];
+ labelText:userEmail];
[emailField setTextColor:[NSColor disabledControlTextColor]];
// Size the container view to fit the longest label.
@@ -63,7 +61,7 @@ const CGFloat kMenuLeftMargin = 3;
}
- (NSTextField*)addLabelWithFrame:(NSPoint)origin
- labelText:(const string16&)labelText {
+ labelText:(const base::string16&)labelText {
tapted 2013/08/14 03:53:11 NSString* for everyone!
calamity 2013/08/14 09:19:00 Done.
NSRect labelFrame = NSZeroRect;
labelFrame.origin = origin;
base::scoped_nsobject<NSTextField> label(

Powered by Google App Engine
This is Rietveld 408576698