summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/cookie_tree_node.h
blob: 0ff6465640a0b35828a99984a036bd2794e652f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// 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.

#import <Cocoa/Cocoa.h>

#include "base/scoped_nsobject.h"
#include "chrome/browser/cookies_tree_model.h"

// This class is used by CookiesWindowController and represents a node in the
// cookie tree view.
@interface CocoaCookieTreeNode : NSObject {
  scoped_nsobject<NSString> title_;
  scoped_nsobject<NSMutableArray> children_;
  // We lazily create children, so we need to know if we are a leaf.
  BOOL isLeaf_;

  // The platform-independent model node.
  CookieTreeNode* treeNode_;  // weak

  // These members are only set for true cookie nodes.
  BOOL isCookie_;
  scoped_nsobject<NSString> name_;
  scoped_nsobject<NSString> content_;
  scoped_nsobject<NSString> domain_;
  scoped_nsobject<NSString> path_;
  scoped_nsobject<NSString> sendFor_;
  // Stringifed dates.
  scoped_nsobject<NSString> created_;
  scoped_nsobject<NSString> expires_;
}

// Designated initializer.
- (id)initWithNode:(CookieTreeNode*)node;

// Re-sets all the members of the node based on |treeNode_|.
- (void)rebuild;

- (BOOL)isLeaf;

// Getters.
- (NSString*)title;

// |-mutableChildren| exists so that the CookiesTreeModelObserverBridge can
// operate on the children. Note that this lazily creates children.
- (NSMutableArray*)mutableChildren;
- (NSArray*)children;

- (TreeModelNode*)treeNode;

// Used only by cookies. Nil for non-cookie nodes.
- (BOOL)isCookie;
- (NSString*)name;
- (NSString*)content;
- (NSString*)domain;
- (NSString*)path;
- (NSString*)sendFor;
- (NSString*)created;
- (NSString*)expires;

@end