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

Unified Diff: chrome/browser/ui/cocoa/cookie_tree_node.mm

Issue 6294008: [Mac] Organize some files into chrome/browser/ui/cocoa/content_settings/.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
Index: chrome/browser/ui/cocoa/cookie_tree_node.mm
===================================================================
--- chrome/browser/ui/cocoa/cookie_tree_node.mm (revision 71852)
+++ chrome/browser/ui/cocoa/cookie_tree_node.mm (working copy)
@@ -1,73 +0,0 @@
-// 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.
-
-#import "chrome/browser/ui/cocoa/cookie_tree_node.h"
-
-#include "base/sys_string_conversions.h"
-
-@implementation CocoaCookieTreeNode
-
-- (id)initWithNode:(CookieTreeNode*)node {
- if ((self = [super init])) {
- DCHECK(node);
- treeNode_ = node;
- [self rebuild];
- }
- return self;
-}
-
-- (void)rebuild {
- title_.reset([base::SysUTF16ToNSString(treeNode_->GetTitle()) retain]);
- children_.reset();
- // The tree node assumes ownership of the cookie details object
- details_.reset([[CocoaCookieDetails createFromCookieTreeNode:(treeNode_)]
- retain]);
-}
-
-- (NSString*)title {
- return title_.get();
-}
-
-- (CocoaCookieDetailsType)nodeType {
- return [details_.get() type];
-}
-
-- (ui::TreeModelNode*)treeNode {
- return treeNode_;
-}
-
-- (NSMutableArray*)mutableChildren {
- if (!children_.get()) {
- const int childCount = treeNode_->GetChildCount();
- children_.reset([[NSMutableArray alloc] initWithCapacity:childCount]);
- for (int i = 0; i < childCount; ++i) {
- CookieTreeNode* child = treeNode_->GetChild(i);
- scoped_nsobject<CocoaCookieTreeNode> childNode(
- [[CocoaCookieTreeNode alloc] initWithNode:child]);
- [children_ addObject:childNode.get()];
- }
- }
- return children_.get();
-}
-
-- (NSArray*)children {
- return [self mutableChildren];
-}
-
-- (BOOL)isLeaf {
- return [self nodeType] != kCocoaCookieDetailsTypeFolder;
-};
-
-- (NSString*)description {
- NSString* format =
- @"<CocoaCookieTreeNode @ %p (title=%@, nodeType=%d, childCount=%u)";
- return [NSString stringWithFormat:format, self, [self title],
- [self nodeType], [[self children] count]];
-}
-
-- (CocoaCookieDetails*)details {
- return details_;
-}
-
-@end

Powered by Google App Engine
This is Rietveld 408576698