| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/scoped_nsobject.h" | 7 #include "base/scoped_nsobject.h" |
| 8 #include "chrome/browser/cookies_tree_model.h" | 8 #include "chrome/browser/cookies_tree_model.h" |
| 9 | 9 |
| 10 // This class is used by CookiesWindowController and represents a node in the | 10 // This class is used by CookiesWindowController and represents a node in the |
| 11 // cookie tree view. | 11 // cookie tree view. |
| 12 @interface CocoaCookieTreeNode : NSObject { | 12 @interface CocoaCookieTreeNode : NSObject { |
| 13 scoped_nsobject<NSString> title_; | 13 scoped_nsobject<NSString> title_; |
| 14 scoped_nsobject<NSMutableArray> children_; | 14 scoped_nsobject<NSMutableArray> children_; |
| 15 // We lazily create children, so we need to know if we are a leaf. |
| 16 BOOL isLeaf_; |
| 15 | 17 |
| 16 // The platform-independent model node. | 18 // The platform-independent model node. |
| 17 CookieTreeNode* treeNode_; // weak | 19 CookieTreeNode* treeNode_; // weak |
| 18 | 20 |
| 19 // These members are only set for true cookie nodes. | 21 // These members are only set for true cookie nodes. |
| 20 BOOL isCookie_; | 22 BOOL isCookie_; |
| 21 scoped_nsobject<NSString> name_; | 23 scoped_nsobject<NSString> name_; |
| 22 scoped_nsobject<NSString> content_; | 24 scoped_nsobject<NSString> content_; |
| 23 scoped_nsobject<NSString> domain_; | 25 scoped_nsobject<NSString> domain_; |
| 24 scoped_nsobject<NSString> path_; | 26 scoped_nsobject<NSString> path_; |
| 25 scoped_nsobject<NSString> sendFor_; | 27 scoped_nsobject<NSString> sendFor_; |
| 26 // Stringifed dates. | 28 // Stringifed dates. |
| 27 scoped_nsobject<NSString> created_; | 29 scoped_nsobject<NSString> created_; |
| 28 scoped_nsobject<NSString> expires_; | 30 scoped_nsobject<NSString> expires_; |
| 29 } | 31 } |
| 30 | 32 |
| 31 // Designated initializer. | 33 // Designated initializer. |
| 32 - (id)initWithNode:(CookieTreeNode*)node; | 34 - (id)initWithNode:(CookieTreeNode*)node; |
| 33 | 35 |
| 34 // Re-sets all the members of the node based on |treeNode_|. | 36 // Re-sets all the members of the node based on |treeNode_|. |
| 35 - (void)rebuild; | 37 - (void)rebuild; |
| 36 | 38 |
| 37 - (BOOL)isLeaf; | 39 - (BOOL)isLeaf; |
| 38 | 40 |
| 39 // Getters. | 41 // Getters. |
| 40 - (NSString*)title; | 42 - (NSString*)title; |
| 41 // |-children| is mutable so that the CookiesTreeModelObserverBridge can | 43 // |-children| is mutable so that the CookiesTreeModelObserverBridge can |
| 42 // operate on the children. | 44 // operate on the children. Note that this lazily creates children. |
| 43 - (NSMutableArray*)children; | 45 - (NSMutableArray*)children; |
| 44 - (TreeModelNode*)treeNode; | 46 - (TreeModelNode*)treeNode; |
| 45 | 47 |
| 46 // Used only by cookies. Nil for non-cookie nodes. | 48 // Used only by cookies. Nil for non-cookie nodes. |
| 47 - (BOOL)isCookie; | 49 - (BOOL)isCookie; |
| 48 - (NSString*)name; | 50 - (NSString*)name; |
| 49 - (NSString*)content; | 51 - (NSString*)content; |
| 50 - (NSString*)domain; | 52 - (NSString*)domain; |
| 51 - (NSString*)path; | 53 - (NSString*)path; |
| 52 - (NSString*)sendFor; | 54 - (NSString*)sendFor; |
| 53 - (NSString*)created; | 55 - (NSString*)created; |
| 54 - (NSString*)expires; | 56 - (NSString*)expires; |
| 55 | 57 |
| 56 @end | 58 @end |
| OLD | NEW |