OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profile_menu_controller.h" | 5 #import "chrome/browser/ui/cocoa/profile_menu_controller.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/avatar_menu_model.h" | 9 #include "chrome/browser/profiles/avatar_menu_model.h" |
10 #include "chrome/browser/profiles/avatar_menu_model_observer.h" | 10 #include "chrome/browser/profiles/avatar_menu_model_observer.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 @interface ProfileMenuController (Private) | 25 @interface ProfileMenuController (Private) |
26 - (void)initializeMenu; | 26 - (void)initializeMenu; |
27 @end | 27 @end |
28 | 28 |
29 namespace ProfileMenuControllerInternal { | 29 namespace ProfileMenuControllerInternal { |
30 | 30 |
31 class Observer : public chrome::BrowserListObserver, | 31 class Observer : public chrome::BrowserListObserver, |
32 public AvatarMenuModelObserver { | 32 public AvatarMenuModelObserver { |
33 public: | 33 public: |
34 Observer(ProfileMenuController* controller) : controller_(controller) { | 34 explicit Observer(ProfileMenuController* controller) |
| 35 : controller_(controller) { |
35 BrowserList::AddObserver(this); | 36 BrowserList::AddObserver(this); |
36 } | 37 } |
37 | 38 |
38 ~Observer() { | 39 ~Observer() { |
39 BrowserList::RemoveObserver(this); | 40 BrowserList::RemoveObserver(this); |
40 } | 41 } |
41 | 42 |
42 // chrome::BrowserListObserver: | 43 // chrome::BrowserListObserver: |
43 virtual void OnBrowserAdded(Browser* browser) {} | 44 virtual void OnBrowserAdded(Browser* browser) {} |
44 virtual void OnBrowserRemoved(Browser* browser) { | 45 virtual void OnBrowserRemoved(Browser* browser) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 } | 215 } |
215 | 216 |
216 - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel { | 217 - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel { |
217 scoped_nsobject<NSMenuItem> item( | 218 scoped_nsobject<NSMenuItem> item( |
218 [[NSMenuItem alloc] initWithTitle:title action:sel keyEquivalent:@""]); | 219 [[NSMenuItem alloc] initWithTitle:title action:sel keyEquivalent:@""]); |
219 [item setTarget:self]; | 220 [item setTarget:self]; |
220 return [item.release() autorelease]; | 221 return [item.release() autorelease]; |
221 } | 222 } |
222 | 223 |
223 @end | 224 @end |
OLD | NEW |