| 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 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/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 AvatarMenuModel; | 15 class AvatarMenuModel; |
| 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 model that contains the data from the backend. | 22 // The model that contains the data from the backend. |
| 23 scoped_ptr<AvatarMenuModel> model_; | 23 scoped_ptr<AvatarMenuModel> model_; |
| 24 | 24 |
| 25 // Array of the below view controllers. | 25 // Array of the below view controllers. |
| 26 scoped_nsobject<NSMutableArray> items_; | 26 scoped_nsobject<NSMutableArray> items_; |
| 27 |
| 28 // Is set to true if the managed user has clicked on Switch Users. |
| 29 BOOL expanded_; |
| 27 } | 30 } |
| 28 | 31 |
| 29 // Designated initializer. The browser is passed to the model for profile | 32 // Designated initializer. The browser is passed to the model for profile |
| 30 // information. | 33 // information. |
| 31 - (id)initWithBrowser:(Browser*)parentBrowser | 34 - (id)initWithBrowser:(Browser*)parentBrowser |
| 32 anchoredAt:(NSPoint)point; | 35 anchoredAt:(NSPoint)point; |
| 33 | 36 |
| 34 // Creats a new profile. | 37 // Creates a new profile. |
| 35 - (IBAction)newProfile:(id)sender; | 38 - (IBAction)newProfile:(id)sender; |
| 36 | 39 |
| 37 // Switches to a given profile. |sender| is an AvatarMenuItemController. | 40 // Switches to a given profile. |sender| is an AvatarMenuItemController. |
| 38 - (IBAction)switchToProfile:(id)sender; | 41 - (IBAction)switchToProfile:(id)sender; |
| 39 | 42 |
| 40 // Edits a given profile. |sender| is an AvatarMenuItemController. | 43 // Edits a given profile. |sender| is an AvatarMenuItemController. |
| 41 - (IBAction)editProfile:(id)sender; | 44 - (IBAction)editProfile:(id)sender; |
| 42 | 45 |
| 43 @end | 46 @end |
| 44 | 47 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 anchoredAt:(NSPoint)point; | 128 anchoredAt:(NSPoint)point; |
| 126 - (void)performLayout; | 129 - (void)performLayout; |
| 127 - (NSMutableArray*)items; | 130 - (NSMutableArray*)items; |
| 128 @end | 131 @end |
| 129 | 132 |
| 130 @interface AvatarMenuItemController (ExposedForTesting) | 133 @interface AvatarMenuItemController (ExposedForTesting) |
| 131 - (void)willStartAnimation:(NSAnimation*)animation; | 134 - (void)willStartAnimation:(NSAnimation*)animation; |
| 132 @end | 135 @end |
| 133 | 136 |
| 134 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ | 137 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ |
| OLD | NEW |