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 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_MENU_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_MENU_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_MENU_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_MENU_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include <memory> |
11 | 11 |
12 class AvatarMenu; | 12 class AvatarMenu; |
13 class Browser; | 13 class Browser; |
14 | 14 |
15 namespace ProfileMenuControllerInternal { | 15 namespace ProfileMenuControllerInternal { |
16 class Observer; | 16 class Observer; |
17 } | 17 } |
18 | 18 |
19 // This controller manages the title and submenu of the Profiles item in the | 19 // This controller manages the title and submenu of the Profiles item in the |
20 // system menu bar. It updates the contents of the menu and the menu's title | 20 // system menu bar. It updates the contents of the menu and the menu's title |
21 // whenever the active browser changes. | 21 // whenever the active browser changes. |
22 @interface ProfileMenuController : NSObject { | 22 @interface ProfileMenuController : NSObject { |
23 @private | 23 @private |
24 // The controller for the profile submenu. | 24 // The controller for the profile submenu. |
25 scoped_ptr<AvatarMenu> avatarMenu_; | 25 std::unique_ptr<AvatarMenu> avatarMenu_; |
26 | 26 |
27 // An observer to be notified when the active browser changes and when the | 27 // An observer to be notified when the active browser changes and when the |
28 // menu model changes. | 28 // menu model changes. |
29 scoped_ptr<ProfileMenuControllerInternal::Observer> observer_; | 29 std::unique_ptr<ProfileMenuControllerInternal::Observer> observer_; |
30 | 30 |
31 // The main menu item to which the profile menu is attached. | 31 // The main menu item to which the profile menu is attached. |
32 NSMenuItem* mainMenuItem_; // weak | 32 NSMenuItem* mainMenuItem_; // weak |
33 } | 33 } |
34 | 34 |
35 // Designated initializer. | 35 // Designated initializer. |
36 - (id)initWithMainMenuItem:(NSMenuItem*)item; | 36 - (id)initWithMainMenuItem:(NSMenuItem*)item; |
37 | 37 |
38 // Actions for the menu items. | 38 // Actions for the menu items. |
39 - (IBAction)switchToProfileFromMenu:(id)sender; | 39 - (IBAction)switchToProfileFromMenu:(id)sender; |
(...skipping 11 matching lines...) Expand all Loading... |
51 @end | 51 @end |
52 | 52 |
53 @interface ProfileMenuController (PrivateExposedForTesting) | 53 @interface ProfileMenuController (PrivateExposedForTesting) |
54 - (NSMenu*)menu; | 54 - (NSMenu*)menu; |
55 - (void)rebuildMenu; | 55 - (void)rebuildMenu; |
56 - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel; | 56 - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel; |
57 - (void)activeBrowserChangedTo:(Browser*)browser; | 57 - (void)activeBrowserChangedTo:(Browser*)browser; |
58 @end | 58 @end |
59 | 59 |
60 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_MENU_CONTROLLER_H_ | 60 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_MENU_CONTROLLER_H_ |
OLD | NEW |