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

Unified Diff: chrome/browser/cocoa/cookie_tree_node.h

Issue 599003: [Mac] Add local storage nodes to the cookie manager (Closed)
Patch Set: Final Created 10 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/nibs/Cookies.xib ('k') | chrome/browser/cocoa/cookie_tree_node.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/cookie_tree_node.h
diff --git a/chrome/browser/cocoa/cookie_tree_node.h b/chrome/browser/cocoa/cookie_tree_node.h
index 0ff6465640a0b35828a99984a036bd2794e652f0..693895e828931e7e76b69f859c5c0ae152280efb 100644
--- a/chrome/browser/cocoa/cookie_tree_node.h
+++ b/chrome/browser/cocoa/cookie_tree_node.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -7,27 +7,46 @@
#include "base/scoped_nsobject.h"
#include "chrome/browser/cookies_tree_model.h"
+// This enum specifies the type of display node a CocoaCookieTreeNode is. If
+// this system is rewritten to not use bindings, this class should be
+// subclassed and specialized, rather than using an enum to determine type.
+enum CocoaCookieTreeNodeType {
+ // Represents grouping data for the actual data.
+ kCocoaCookieTreeNodeTypeFolder = 0,
+
+ // A cookie node.
+ kCocoaCookieTreeNodeTypeCookie = 1,
+
+ // A local storage node.
+ kCocoaCookieTreeNodeTypeLocalStorage = 2
+};
+
// 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_;
+
+ CocoaCookieTreeNodeType nodeType_;
// The platform-independent model node.
CookieTreeNode* treeNode_; // weak
- // These members are only set for true cookie nodes.
- BOOL isCookie_;
+ // These members are only set for kCocoaCookieTreeNodeTypeCookie nodes.
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_;
+
+ // These members are only set for kCocoaCookieTreeNodeTypeLocalStorage nodes.
+ scoped_nsobject<NSString> fileSize_;
+ scoped_nsobject<NSString> lastModified_;
+
+ // These members are set for both of the two specialized node types.
+ scoped_nsobject<NSString> domain_;
}
// Designated initializer.
@@ -36,20 +55,18 @@
// Re-sets all the members of the node based on |treeNode_|.
- (void)rebuild;
-- (BOOL)isLeaf;
-
-// Getters.
+// Common getters..
- (NSString*)title;
+- (CocoaCookieTreeNodeType)nodeType;
+- (TreeModelNode*)treeNode;
// |-mutableChildren| exists so that the CookiesTreeModelObserverBridge can
// operate on the children. Note that this lazily creates children.
- (NSMutableArray*)mutableChildren;
- (NSArray*)children;
+- (BOOL)isLeaf;
-- (TreeModelNode*)treeNode;
-
-// Used only by cookies. Nil for non-cookie nodes.
-- (BOOL)isCookie;
+// Used only by kCocoaCookieTreeNodeTypeCookie. Nil for other types.
- (NSString*)name;
- (NSString*)content;
- (NSString*)domain;
@@ -58,4 +75,8 @@
- (NSString*)created;
- (NSString*)expires;
+// Used by kCocoaCookieTreeNodeTypeLocalStorage nodes. Nil for other types.
+- (NSString*)fileSize;
+- (NSString*)lastModified;
+
@end
« no previous file with comments | « chrome/app/nibs/Cookies.xib ('k') | chrome/browser/cocoa/cookie_tree_node.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698