cookie_tree_node.h revision eb525c5499e34cc9c4b825d6d9e75bb07cc06ace
1// Copyright (c) 2011 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.
4
5#import <Cocoa/Cocoa.h>
6
7#include "base/mac/scoped_nsobject.h"
8#include "chrome/browser/browsing_data/cookies_tree_model.h"
9#include "chrome/browser/ui/cocoa/content_settings/cookie_details.h"
10
11@interface CocoaCookieTreeNode : NSObject {
12  base::scoped_nsobject<NSString> title_;
13  base::scoped_nsobject<NSMutableArray> children_;
14  base::scoped_nsobject<CocoaCookieDetails> details_;
15  CookieTreeNode* treeNode_;  // weak
16}
17
18// Designated initializer.
19- (id)initWithNode:(CookieTreeNode*)node;
20
21// Re-sets all the members of the node based on |treeNode_|.
22- (void)rebuild;
23
24// Common getters..
25- (NSString*)title;
26- (CocoaCookieDetailsType)nodeType;
27- (ui::TreeModelNode*)treeNode;
28
29// |-mutableChildren| exists so that the CookiesTreeModelObserverBridge can
30// operate on the children. Note that this lazily creates children.
31- (NSMutableArray*)mutableChildren;
32- (NSArray*)children;
33- (BOOL)isLeaf;
34
35- (CocoaCookieDetails*)details;
36
37@end
38