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

Unified Diff: chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h

Issue 151593005: Implement permission bubble view for Cocoa. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ensure only one delegate owns the view at a time 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h b/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h
new file mode 100644
index 0000000000000000000000000000000000000000..75df0757258fee8a9a2ed69a547714e1deae45e1
--- /dev/null
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h
@@ -0,0 +1,45 @@
+// Copyright 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.
+
+#ifndef CHROME_BROWSER_UI_COCOA_PERMISSION_BUBBLE_COCOA_H_
+#define CHROME_BROWSER_UI_COCOA_PERMISSION_BUBBLE_COCOA_H_
+
+#include "base/mac/scoped_nsobject.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/ui/website_settings/permission_bubble_view.h"
+#include "content/public/browser/web_contents.h"
+
+#ifdef __OBJC__
+@class PermissionBubbleController;
+#else
+class PermissionBubbleController;
+#endif
+
+class PermissionBubbleCocoa : public PermissionBubbleView {
+ public:
+ explicit PermissionBubbleCocoa(NSWindow* parent_window);
+ virtual ~PermissionBubbleCocoa();
+
+ // PermissionBubbleView interface.
+ virtual void Show(const std::vector<PermissionBubbleRequest*>& requests,
+ const std::vector<bool>& accept_state,
+ bool customization_mode) OVERRIDE;
+ virtual void Hide() OVERRIDE;
+ virtual void SetDelegate(Delegate* delegate) OVERRIDE;
+
+ // Called when |bubbleController_| is closing.
+ void OnBubbleClosing();
+
+ private:
+ NSWindow* parent_window_; // Weak.
+ Delegate* delegate_; // Weak.
+
+ // Cocoa-side UI controller for the bubble. Weak, as it will close itself.
+ PermissionBubbleController* bubbleController_;
+
+ DISALLOW_COPY_AND_ASSIGN(PermissionBubbleCocoa);
+};
+
+#endif // CHROME_BROWSER_UI_COCOA_PERMISSION_BUBBLE_COCOA_H_

Powered by Google App Engine
This is Rietveld 408576698