OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #import "chrome/browser/ui/cocoa/autofill/autofill_notification_container.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_notification_container.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
10 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" | 10 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 [[self view] setSubviews:@[]]; | 69 [[self view] setSubviews:@[]]; |
70 | 70 |
71 for (size_t i = 0; i < notifications.size(); ++i) { | 71 for (size_t i = 0; i < notifications.size(); ++i) { |
72 // Create basic notification view. | 72 // Create basic notification view. |
73 const autofill::DialogNotification& notification = notifications[i]; | 73 const autofill::DialogNotification& notification = notifications[i]; |
74 base::scoped_nsobject<AutofillNotificationController> | 74 base::scoped_nsobject<AutofillNotificationController> |
75 notificationController([[AutofillNotificationController alloc] | 75 notificationController([[AutofillNotificationController alloc] |
76 initWithNotification:¬ification | 76 initWithNotification:¬ification |
77 delegate:delegate_]); | 77 delegate:delegate_]); |
78 | 78 |
| 79 if (i == 0) { |
| 80 [notificationController setHasArrow:notification.HasArrow() |
| 81 withAnchorView:anchorView_]; |
| 82 } |
| 83 |
79 [notificationControllers_ addObject:notificationController]; | 84 [notificationControllers_ addObject:notificationController]; |
80 [[self view] addSubview:[notificationController view]]; | 85 [[self view] addSubview:[notificationController view]]; |
81 } | 86 } |
82 } | 87 } |
83 | 88 |
84 - (void)setAnchorView:(NSView*)anchorView { | 89 - (void)setAnchorView:(NSView*)anchorView { |
85 anchorView_ = anchorView; | 90 anchorView_ = anchorView; |
86 } | 91 } |
87 | 92 |
88 @end | 93 @end |
OLD | NEW |