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/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 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 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 managed 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 model for profile | 32 // Designated initializer. The browser is passed to the model 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 |
(...skipping 21 matching lines...) Expand all Loading... |
58 __weak AvatarMenuBubbleController* controller_; | 58 __weak AvatarMenuBubbleController* controller_; |
59 | 59 |
60 // The AvatarMenuModel::item.model_index field. | 60 // The AvatarMenuModel::item.model_index field. |
61 size_t modelIndex_; | 61 size_t modelIndex_; |
62 | 62 |
63 // Tracks whether this item is currently highlighted. | 63 // Tracks whether this item is currently highlighted. |
64 BOOL isHighlighted_; | 64 BOOL isHighlighted_; |
65 | 65 |
66 // The animation showing the edit link, which is run after the user has | 66 // The animation showing the edit link, which is run after the user has |
67 // dwelled over the item for a short delay. | 67 // dwelled over the item for a short delay. |
68 scoped_nsobject<NSAnimation> linkAnimation_; | 68 base::scoped_nsobject<NSAnimation> linkAnimation_; |
69 | 69 |
70 // Instance variables that back the outlets. | 70 // Instance variables that back the outlets. |
71 __weak NSImageView* iconView_; | 71 __weak NSImageView* iconView_; |
72 __weak NSImageView* activeView_; | 72 __weak NSImageView* activeView_; |
73 __weak NSTextField* nameField_; | 73 __weak NSTextField* nameField_; |
74 // These two views sit on top of each other, and only one is visible at a | 74 // These two views sit on top of each other, and only one is visible at a |
75 // time. The editButton_ is visible when the mouse is over the item and the | 75 // time. The editButton_ is visible when the mouse is over the item and the |
76 // emailField_ is visible otherwise. | 76 // emailField_ is visible otherwise. |
77 __weak NSTextField* emailField_; | 77 __weak NSTextField* emailField_; |
78 __weak NSButton* editButton_; | 78 __weak NSButton* editButton_; |
(...skipping 53 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_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ | 141 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ |
OLD | NEW |