Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/ui/cocoa/permission_bubble_controller.h

Issue 151593005: Implement permission bubble view for Cocoa. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more feedback addressed Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698