1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTAINER_H_ 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTAINER_H_ 7 8 #import <Cocoa/Cocoa.h> 9 10 #include <vector> 11 12 #include "base/mac/scoped_nsobject.h" 13 #include "base/memory/scoped_ptr.h" 14 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" 15 16 @class AutofillArrowView; 17 18 namespace autofill { 19 class DialogNotification; 20 typedef std::vector<DialogNotification> DialogNotifications; 21 class AutofillDialogViewDelegate; 22 } 23 24 // Container for all notifications shown in requestAutocomplete dialog. 25 @interface AutofillNotificationContainer : NSViewController<AutofillLayout> { 26 @private 27 // Array of all AutofillNotificationControllers. 28 base::scoped_nsobject<NSMutableArray> notificationControllers_; 29 30 // View that the arrow is anchored to. Weak. 31 NSView* anchorView_; 32 33 // Main delegate for the dialog. Weak, owns dialog. 34 autofill::AutofillDialogViewDelegate* delegate_; 35 } 36 37 // Designated initializer. 38 - (id)initWithDelegate:(autofill::AutofillDialogViewDelegate*)delegate; 39 40 // Computes the views preferred size given a fixed width. 41 - (NSSize)preferredSizeForWidth:(CGFloat)width; 42 43 // Sets the notification contents. 44 - (void)setNotifications:(const autofill::DialogNotifications&) notifications; 45 46 // Sets a view that the arrow is anchored to - center of arrow will be aligned 47 // with center of anchorView. (horizontally only). 48 - (void)setAnchorView:(NSView*)anchorView; 49 50 @end 51 52 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTAINER_H_ 53