OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/profiles/profile_menu_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/profile_menu_controller.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 [NSApp activateIgnoringOtherApps:YES]; | 107 [NSApp activateIgnoringOtherApps:YES]; |
108 avatarMenu_->SwitchToProfile([sender tag], false, | 108 avatarMenu_->SwitchToProfile([sender tag], false, |
109 ProfileMetrics::SWITCH_PROFILE_DOCK); | 109 ProfileMetrics::SWITCH_PROFILE_DOCK); |
110 } | 110 } |
111 | 111 |
112 - (IBAction)editProfile:(id)sender { | 112 - (IBAction)editProfile:(id)sender { |
113 avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex()); | 113 avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex()); |
114 } | 114 } |
115 | 115 |
116 - (IBAction)newProfile:(id)sender { | 116 - (IBAction)newProfile:(id)sender { |
117 profiles::CreateAndSwitchToNewProfile(chrome::HOST_DESKTOP_TYPE_NATIVE, | 117 profiles::CreateAndSwitchToNewProfile(ui::HOST_DESKTOP_TYPE_NATIVE, |
118 ProfileManager::CreateCallback(), | 118 ProfileManager::CreateCallback(), |
119 ProfileMetrics::ADD_NEW_USER_MENU); | 119 ProfileMetrics::ADD_NEW_USER_MENU); |
120 } | 120 } |
121 | 121 |
122 - (BOOL)insertItemsIntoMenu:(NSMenu*)menu | 122 - (BOOL)insertItemsIntoMenu:(NSMenu*)menu |
123 atOffset:(NSInteger)offset | 123 atOffset:(NSInteger)offset |
124 fromDock:(BOOL)dock { | 124 fromDock:(BOOL)dock { |
125 if (!avatarMenu_ || !avatarMenu_->ShouldShowAvatarMenu()) | 125 if (!avatarMenu_ || !avatarMenu_->ShouldShowAvatarMenu()) |
126 return NO; | 126 return NO; |
127 | 127 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel { | 303 - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel { |
304 base::scoped_nsobject<NSMenuItem> item( | 304 base::scoped_nsobject<NSMenuItem> item( |
305 [[NSMenuItem alloc] initWithTitle:title action:sel keyEquivalent:@""]); | 305 [[NSMenuItem alloc] initWithTitle:title action:sel keyEquivalent:@""]); |
306 [item setTarget:self]; | 306 [item setTarget:self]; |
307 return [item.release() autorelease]; | 307 return [item.release() autorelease]; |
308 } | 308 } |
309 | 309 |
310 @end | 310 @end |
OLD | NEW |