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