OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 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 #import <Cocoa/Cocoa.h> |
| 6 |
| 7 #include "base/mac/scoped_nsobject.h" |
| 8 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
| 9 #include "chrome/browser/ui/website_settings/permission_bubble_view.h" |
| 10 |
| 11 class PermissionBubbleCocoa; |
| 12 class PermissionBubbleRequest; |
| 13 |
| 14 @interface PermissionBubbleController : |
| 15 BaseBubbleController<NSTextViewDelegate> { |
| 16 @private |
| 17 // Array of views that are the checkboxes for every requested permission. |
| 18 // Only populated if |customizationMode| is YES when the UI is shown. |
| 19 base::scoped_nsobject<NSMutableArray> checkboxes_; |
| 20 |
| 21 // Delegate to be informed of user actions. |
| 22 PermissionBubbleView::Delegate* delegate_; // Weak. |
| 23 |
| 24 // Bridge to the C++ class that created this object. |
| 25 PermissionBubbleCocoa* bridge_; // Weak. |
| 26 } |
| 27 |
| 28 // Designated initializer. |parentWindow| and |bridge| must both be non-nil. |
| 29 - (id)initWithParentWindow:(NSWindow*)parentWindow |
| 30 bridge:(PermissionBubbleCocoa*)bridge; |
| 31 |
| 32 // Makes the bubble visible, with an arrow pointing to |anchor|. The bubble |
| 33 // will be populated with text retrieved from |requests|. If |
| 34 // |customizationMode| is YES, each request will have a checkbox, with its state |
| 35 // set to the corresponding element in |acceptStates|. If it is NO, each |
| 36 // request will have a bullet point and |acceptStates| may be empty. |delegate| |
| 37 // will receive callbacks for user actions. |
| 38 - (void)showAtAnchor:(NSPoint)anchor |
| 39 withDelegate:(PermissionBubbleView::Delegate*)delegate |
| 40 forRequests:(const std::vector<PermissionBubbleRequest*>&)requests |
| 41 acceptStates:(const std::vector<bool>&)acceptStates |
| 42 customizationMode:(BOOL)customizationMode; |
| 43 |
| 44 @end |
OLD | NEW |