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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/permission_bubble_controller.h
diff --git a/chrome/browser/ui/cocoa/permission_bubble_controller.h b/chrome/browser/ui/cocoa/permission_bubble_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..a6c76f1abc537afb6d315dd3de1f2f0e919ebe11
--- /dev/null
+++ b/chrome/browser/ui/cocoa/permission_bubble_controller.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import <Cocoa/Cocoa.h>
+
+#include <vector>
groby-ooo-7-16 2014/02/04 02:39:30 Not needed any more
leng 2014/02/04 21:48:22 Done.
+
+#include "base/mac/scoped_nsobject.h"
+#import "chrome/browser/ui/cocoa/base_bubble_controller.h"
+#include "chrome/browser/ui/website_settings/permission_bubble_delegate.h"
+#include "chrome/browser/ui/website_settings/permission_bubble_view.h"
+
+class PermissionBubbleCocoa;
+
+@interface PermissionBubbleController :
+ BaseBubbleController<NSTextViewDelegate> {
+ @private
+ // Array of views that are the checkboxes for every requested permission.
+ // Only populated if |customizationMode| is YES when the UI is shown.
+ base::scoped_nsobject<NSMutableArray> checkboxes_;
+
+ // Delegate to be informed of user actions.
+ PermissionBubbleView::Delegate* delegate_; // Weak.
+
+ // Bridge to the C++ class that created this object.
+ PermissionBubbleCocoa* bridge_; // Weak.
+}
+
+// Designated initializer. |parentWindow| and |bridge| must both be non-nil.
+- (id)initWithParentWindow:(NSWindow*)parentWindow
+ bridge:(PermissionBubbleCocoa*)bridge;
+
+// Makes the bubble visible, with an arrow pointing to |anchor|. The bubble
+// will be populated with text retrieved from |requests|. If
+// |customizationMode| is YES, each request will have a checkbox, with its state
+// set to the corresponding element in |acceptStates|. If it is NO, each
+// request will have a bullet point and |acceptStates| may be empty. |delegate|
+// will receive callbacks for user actions.
+- (void)showAtAnchor:(NSPoint)anchor
+ withDelegate:(PermissionBubbleView::Delegate*)delegate
+ forRequests:(const std::vector<PermissionBubbleDelegate*>&)requests
+ acceptStates:(const std::vector<bool>&)acceptStates
+ customizationMode:(BOOL)customizationMode;
+
+@end
+

Powered by Google App Engine
This is Rietveld 408576698