| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/mac/cocoa_protocols.h" | 10 #include "base/mac/cocoa_protocols.h" |
| 11 #include "base/memory/scoped_nsobject.h" | 11 #include "base/memory/scoped_nsobject.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 13 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
| 14 #import "chrome/browser/ui/cocoa/tracking_area.h" | 14 #import "chrome/browser/ui/cocoa/tracking_area.h" |
| 15 | 15 |
| 16 class AvatarMenuModel; | 16 class AvatarMenuModel; |
| 17 class AvatarMenuModelObserver; | |
| 18 class Browser; | 17 class Browser; |
| 19 @class HoverImageButton; | 18 @class HoverImageButton; |
| 20 | 19 |
| 21 // This window controller manages the bubble that displays a "menu" of profiles. | 20 // This window controller manages the bubble that displays a "menu" of profiles. |
| 22 // It is brought open by clicking on the avatar icon in the window frame. | 21 // It is brought open by clicking on the avatar icon in the window frame. |
| 23 @interface AvatarMenuBubbleController : BaseBubbleController { | 22 @interface AvatarMenuBubbleController : BaseBubbleController { |
| 24 @private | 23 @private |
| 25 // The model that contains the data from the backend. | 24 // The model that contains the data from the backend. |
| 26 scoped_ptr<AvatarMenuModel> model_; | 25 scoped_ptr<AvatarMenuModel> model_; |
| 27 | 26 |
| 28 // Observer for changes to the model. | |
| 29 scoped_ptr<AvatarMenuModelObserver> bridge_; | |
| 30 | |
| 31 // Array of the below view controllers. | 27 // Array of the below view controllers. |
| 32 scoped_nsobject<NSMutableArray> items_; | 28 scoped_nsobject<NSMutableArray> items_; |
| 33 } | 29 } |
| 34 | 30 |
| 35 // Designated initializer. The browser is passed to the model for profile | 31 // Designated initializer. The browser is passed to the model for profile |
| 36 // information. | 32 // information. |
| 37 - (id)initWithBrowser:(Browser*)parentBrowser | 33 - (id)initWithBrowser:(Browser*)parentBrowser |
| 38 anchoredAt:(NSPoint)point; | 34 anchoredAt:(NSPoint)point; |
| 39 | 35 |
| 40 // Creats a new profile. | 36 // Creats a new profile. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 @interface AccessibilityIgnoredImageCell : NSImageCell | 116 @interface AccessibilityIgnoredImageCell : NSImageCell |
| 121 @end | 117 @end |
| 122 | 118 |
| 123 @interface AccessibilityIgnoredTextFieldCell : NSTextFieldCell | 119 @interface AccessibilityIgnoredTextFieldCell : NSTextFieldCell |
| 124 @end | 120 @end |
| 125 | 121 |
| 126 // Testing API ///////////////////////////////////////////////////////////////// | 122 // Testing API ///////////////////////////////////////////////////////////////// |
| 127 | 123 |
| 128 @interface AvatarMenuBubbleController (ExposedForTesting) | 124 @interface AvatarMenuBubbleController (ExposedForTesting) |
| 129 - (id)initWithModel:(AvatarMenuModel*)model | 125 - (id)initWithModel:(AvatarMenuModel*)model |
| 130 bridge:(AvatarMenuModelObserver*)bridge | |
| 131 parentWindow:(NSWindow*)parent | 126 parentWindow:(NSWindow*)parent |
| 132 anchoredAt:(NSPoint)point; | 127 anchoredAt:(NSPoint)point; |
| 133 - (void)performLayout; | 128 - (void)performLayout; |
| 134 - (NSMutableArray*)items; | 129 - (NSMutableArray*)items; |
| 135 @end | 130 @end |
| 136 | 131 |
| 137 @interface AvatarMenuItemController (ExposedForTesting) | 132 @interface AvatarMenuItemController (ExposedForTesting) |
| 138 - (void)willStartAnimation:(NSAnimation*)animation; | 133 - (void)willStartAnimation:(NSAnimation*)animation; |
| 139 @end | 134 @end |
| 140 | 135 |
| 141 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ | 136 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_AVATAR_MENU_BUBBLE_CONTROLLER_H_ |
| OLD | NEW |