| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/cocoa/content_settings/cookie_details.h" | 5 #include "chrome/browser/ui/cocoa/content_settings/cookie_details.h" |
| 6 | 6 |
| 7 #import "base/i18n/time_formatting.h" | 7 #import "base/i18n/time_formatting.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/browsing_data/cookies_tree_model.h" | 9 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 238 } |
| 239 return self; | 239 return self; |
| 240 } | 240 } |
| 241 | 241 |
| 242 - (id)initWithIndexedDBInfo: | 242 - (id)initWithIndexedDBInfo: |
| 243 (const content::IndexedDBInfo*)indexedDBInfo { | 243 (const content::IndexedDBInfo*)indexedDBInfo { |
| 244 if ((self = [super init])) { | 244 if ((self = [super init])) { |
| 245 type_ = kCocoaCookieDetailsTypeTreeIndexedDB; | 245 type_ = kCocoaCookieDetailsTypeTreeIndexedDB; |
| 246 canEditExpiration_ = NO; | 246 canEditExpiration_ = NO; |
| 247 domain_.reset([base::SysUTF8ToNSString( | 247 domain_.reset([base::SysUTF8ToNSString( |
| 248 indexedDBInfo->origin.spec()) retain]); | 248 indexedDBInfo->origin_.spec()) retain]); |
| 249 fileSize_.reset([base::SysUTF16ToNSString( | 249 fileSize_.reset([base::SysUTF16ToNSString( |
| 250 ui::FormatBytes(indexedDBInfo->size)) retain]); | 250 ui::FormatBytes(indexedDBInfo->size_)) retain]); |
| 251 lastModified_.reset([base::SysUTF16ToNSString( | 251 lastModified_.reset([base::SysUTF16ToNSString( |
| 252 base::TimeFormatFriendlyDateAndTime( | 252 base::TimeFormatFriendlyDateAndTime( |
| 253 indexedDBInfo->last_modified)) retain]); | 253 indexedDBInfo->last_modified_)) retain]); |
| 254 } | 254 } |
| 255 return self; | 255 return self; |
| 256 } | 256 } |
| 257 | 257 |
| 258 + (CocoaCookieDetails*)createFromCookieTreeNode:(CookieTreeNode*)treeNode { | 258 + (CocoaCookieDetails*)createFromCookieTreeNode:(CookieTreeNode*)treeNode { |
| 259 CookieTreeNode::DetailedInfo info = treeNode->GetDetailedInfo(); | 259 CookieTreeNode::DetailedInfo info = treeNode->GetDetailedInfo(); |
| 260 CookieTreeNode::DetailedInfo::NodeType nodeType = info.node_type; | 260 CookieTreeNode::DetailedInfo::NodeType nodeType = info.node_type; |
| 261 switch (nodeType) { | 261 switch (nodeType) { |
| 262 case CookieTreeNode::DetailedInfo::TYPE_COOKIE: | 262 case CookieTreeNode::DetailedInfo::TYPE_COOKIE: |
| 263 return [[[CocoaCookieDetails alloc] initWithCookie:info.cookie | 263 return [[[CocoaCookieDetails alloc] initWithCookie:info.cookie |
| (...skipping 26 matching lines...) Expand all Loading... |
| 290 details_.reset([details retain]); | 290 details_.reset([details retain]); |
| 291 } | 291 } |
| 292 return self; | 292 return self; |
| 293 } | 293 } |
| 294 | 294 |
| 295 - (CocoaCookieDetails*)details { | 295 - (CocoaCookieDetails*)details { |
| 296 return details_.get(); | 296 return details_.get(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 @end | 299 @end |
| OLD | NEW |