| 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_AVATAR_MENU_BUBBLE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_MENU_BUBBLE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_MENU_BUBBLE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_MENU_BUBBLE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 12 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
| 13 #import "ui/base/cocoa/tracking_area.h" | 13 #import "ui/base/cocoa/tracking_area.h" |
| 14 | 14 |
| 15 class AvatarMenu; | 15 class AvatarMenu; |
| 16 class Browser; | 16 class Browser; |
| 17 | 17 |
| 18 // This window controller manages the bubble that displays a "menu" of profiles. | 18 // This window controller manages the bubble that displays a "menu" of profiles. |
| 19 // It is brought open by clicking on the avatar icon in the window frame. | 19 // It is brought open by clicking on the avatar icon in the window frame. |
| 20 @interface AvatarMenuBubbleController : BaseBubbleController { | 20 @interface AvatarMenuBubbleController : BaseBubbleController { |
| 21 @private | 21 @private |
| 22 // The menu that contains the data from the backend. | 22 // The menu that contains the data from the backend. |
| 23 scoped_ptr<AvatarMenu> menu_; | 23 scoped_ptr<AvatarMenu> menu_; |
| 24 | 24 |
| 25 // Array of the below view controllers. | 25 // Array of the below view controllers. |
| 26 base::scoped_nsobject<NSMutableArray> items_; | 26 base::scoped_nsobject<NSMutableArray> items_; |
| 27 | 27 |
| 28 // Is set to true if the managed user has clicked on Switch Users. | 28 // Is set to true if the supervised user has clicked on Switch Users. |
| 29 BOOL expanded_; | 29 BOOL expanded_; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // Designated initializer. The browser is passed to the menu for profile | 32 // Designated initializer. The browser is passed to the menu for profile |
| 33 // information. | 33 // information. |
| 34 - (id)initWithBrowser:(Browser*)parentBrowser | 34 - (id)initWithBrowser:(Browser*)parentBrowser |
| 35 anchoredAt:(NSPoint)point; | 35 anchoredAt:(NSPoint)point; |
| 36 | 36 |
| 37 // Creates a new profile. | 37 // Creates a new profile. |
| 38 - (IBAction)newProfile:(id)sender; | 38 - (IBAction)newProfile:(id)sender; |
| 39 | 39 |
| 40 // Switches to a given profile. |sender| is an AvatarMenuItemController. | 40 // Switches to a given profile. |sender| is an AvatarMenuItemController. |
| 41 - (IBAction)switchToProfile:(id)sender; | 41 - (IBAction)switchToProfile:(id)sender; |
| 42 | 42 |
| 43 // Edits a given profile. |sender| is an AvatarMenuItemController. | 43 // Edits a given profile. |sender| is an AvatarMenuItemController. |
| 44 - (IBAction)editProfile:(id)sender; | 44 - (IBAction)editProfile:(id)sender; |
| 45 | 45 |
| 46 // Switches from the managed user avatar menu to the normal avatar menu which | 46 // Switches from the supervised user avatar menu to the normal avatar menu which |
| 47 // allows to switch profiles. | 47 // allows to switch profiles. |
| 48 - (IBAction)switchProfile:(id)sender; | 48 - (IBAction)switchProfile:(id)sender; |
| 49 | 49 |
| 50 @end | 50 @end |
| 51 | 51 |
| 52 //////////////////////////////////////////////////////////////////////////////// | 52 //////////////////////////////////////////////////////////////////////////////// |
| 53 | 53 |
| 54 // This view controller manages the menu item XIB. | 54 // This view controller manages the menu item XIB. |
| 55 @interface AvatarMenuItemController : NSViewController<NSAnimationDelegate> { | 55 @interface AvatarMenuItemController : NSViewController<NSAnimationDelegate> { |
| 56 @private | 56 @private |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 anchoredAt:(NSPoint)point; | 132 anchoredAt:(NSPoint)point; |
| 133 - (void)performLayout; | 133 - (void)performLayout; |
| 134 - (NSMutableArray*)items; | 134 - (NSMutableArray*)items; |
| 135 @end | 135 @end |
| 136 | 136 |
| 137 @interface AvatarMenuItemController (ExposedForTesting) | 137 @interface AvatarMenuItemController (ExposedForTesting) |
| 138 - (void)willStartAnimation:(NSAnimation*)animation; | 138 - (void)willStartAnimation:(NSAnimation*)animation; |
| 139 @end | 139 @end |
| 140 | 140 |
| 141 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_MENU_BUBBLE_CONTROLLER_H_ | 141 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_MENU_BUBBLE_CONTROLLER_H_ |
| OLD | NEW |