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

Unified Diff: chrome/browser/cocoa/blocked_popup_container_controller.h

Issue 150132: First cut at popup blocking for Mac. Remove ifdefs in cross-platform code. Im... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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/cocoa/blocked_popup_container_controller.h
===================================================================
--- chrome/browser/cocoa/blocked_popup_container_controller.h (revision 0)
+++ chrome/browser/cocoa/blocked_popup_container_controller.h (revision 0)
@@ -0,0 +1,52 @@
+// Copyright (c) 2009 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_VIEWS_BLOCKED_POPUP_CONTAINER_CONTROLLER_H_
+#define CHROME_BROWSER_VIEWS_BLOCKED_POPUP_CONTAINER_CONTROLLER_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/scoped_nsobject.h"
+#include "base/scoped_ptr.h"
+#include "chrome/browser/blocked_popup_container.h"
+
+// Controller for the blocked popup view. Communicates with the cross-platform
+// code via a C++ bridge class, below. The BlockedPopupContainer class doesn't
+// really "own" the bridge, it just keeps a pointer to it and calls Destroy() on
+// it when it's supposed to go away. As a result, this class needs to own itself
+// (always keep an extra retain), and will autorelease itself (and the bridge
+// which it owns) when the bridge gets a Destroy() message.
+// TODO(pinkerton): Reverse the ownership if it makes more sense. I'm leaving
+// it this way because I assume we eventually want this to be a
+// NSViewController, and we usually have the Obj-C controller owning the
+// bridge (rather than the other way around).
+@interface BlockedPopupContainerController : NSObject {
+ @private
+ scoped_ptr<BlockedPopupContainerView> bridge_;
+ BlockedPopupContainer* container_; // Weak. "owns" me.
+ scoped_nsobject<NSView> view_;
+ IBOutlet NSTextField* label_;
+}
+
+// Initialize with the given popup container. Creates the C++ bridge object
+// used to represet the "view".
+- (id)initWithContainer:(BlockedPopupContainer*)container;
+
+// Returns the C++ brige object.
+- (BlockedPopupContainerView*)bridge;
+
+// Called by the bridge to perform certain actions from the back-end code.
+- (void)show;
+- (void)hide;
+- (void)update;
+
+@end
+
+@interface BlockedPopupContainerController(ForTesting)
+- (NSView*)view;
+- (NSView*)label;
+- (IBAction)closePopup:(id)sender;
+@end
+
+#endif // CHROME_BROWSER_VIEWS_BLOCKED_POPUP_CONTAINER_CONTROLLER_H_
Property changes on: chrome/browser/cocoa/blocked_popup_container_controller.h
___________________________________________________________________
Name: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698