1 // Copyright (c) 2012 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.
5 #import <Cocoa/Cocoa.h>
7 #include "net/cookies/cookie_monster.h"
9 @
class CocoaCookieTreeNode
;
10 @
class GTMUILocalizerAndLayoutTweaker
;
12 // Controller for the view that displays the details of a cookie,
13 // used both in the cookie prompt dialog as well as the
14 // show cookies preference sheet of content settings preferences.
15 @interface CookieDetailsViewController
: NSViewController
{
17 // Allows direct access to the object controller for
18 // the displayed cookie information.
19 IBOutlet NSObjectController
* objectController_
;
21 // This explicit reference to the layout tweaker is
22 // required because it's necessary to reformat the view when
23 // the content object changes, since the content object may
24 // alter the widths of some of the fields displayed in the view.
25 IBOutlet GTMUILocalizerAndLayoutTweaker
* tweaker_
;
28 @
property(nonatomic
, readonly
) BOOL hasExpiration
;
32 // Configures the cookie detail view that is managed by the controller
33 // to display the information about a single cookie, the information
34 // for which is explicitly passed in the parameter |content|.
35 - (void)setContentObject
:(id
)content
;
37 // Adjust the size of the view to exactly fix the information text fields
38 // that are visible inside it.
39 - (void)shrinkViewToFit
;
41 // Called by the cookie tree dialog to establish a binding between
42 // the the detail view's object controller and the tree controller.
43 // This binding allows the cookie tree to use the detail view unmodified.
44 - (void)configureBindingsForTreeController
:(NSTreeController
*)controller
;
46 // Action sent by the expiration date popup when the user
47 // selects the menu item "When I close my browser".
48 - (IBAction
)setCookieDoesntHaveExplicitExpiration
:(id
)sender
;
50 // Action sent by the expiration date popup when the user
51 // selects the menu item with an explicit date/time of expiration.
52 - (IBAction
)setCookieHasExplicitExpiration
:(id
)sender
;