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( |