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

Side by Side 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, 5 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
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file.
4
5 #ifndef CHROME_BROWSER_VIEWS_BLOCKED_POPUP_CONTAINER_CONTROLLER_H_
6 #define CHROME_BROWSER_VIEWS_BLOCKED_POPUP_CONTAINER_CONTROLLER_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #include "base/scoped_nsobject.h"
11 #include "base/scoped_ptr.h"
12 #include "chrome/browser/blocked_popup_container.h"
13
14 // Controller for the blocked popup view. Communicates with the cross-platform
15 // code via a C++ bridge class, below. The BlockedPopupContainer class doesn't
16 // really "own" the bridge, it just keeps a pointer to it and calls Destroy() on
17 // it when it's supposed to go away. As a result, this class needs to own itself
18 // (always keep an extra retain), and will autorelease itself (and the bridge
19 // which it owns) when the bridge gets a Destroy() message.
20 // TODO(pinkerton): Reverse the ownership if it makes more sense. I'm leaving
21 // it this way because I assume we eventually want this to be a
22 // NSViewController, and we usually have the Obj-C controller owning the
23 // bridge (rather than the other way around).
24 @interface BlockedPopupContainerController : NSObject {
25 @private
26 scoped_ptr<BlockedPopupContainerView> bridge_;
27 BlockedPopupContainer* container_; // Weak. "owns" me.
28 scoped_nsobject<NSView> view_;
29 IBOutlet NSTextField* label_;
30 }
31
32 // Initialize with the given popup container. Creates the C++ bridge object
33 // used to represet the "view".
34 - (id)initWithContainer:(BlockedPopupContainer*)container;
35
36 // Returns the C++ brige object.
37 - (BlockedPopupContainerView*)bridge;
38
39 // Called by the bridge to perform certain actions from the back-end code.
40 - (void)show;
41 - (void)hide;
42 - (void)update;
43
44 @end
45
46 @interface BlockedPopupContainerController(ForTesting)
47 - (NSView*)view;
48 - (NSView*)label;
49 - (IBAction)closePopup:(id)sender;
50 @end
51
52 #endif // CHROME_BROWSER_VIEWS_BLOCKED_POPUP_CONTAINER_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698