Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "chrome/browser/cookies_tree_model.h" | 10 #include "chrome/browser/cookies_tree_model.h" |
| 11 #include "ui/base/l10n/l10n_util_mac.h" | 11 #include "ui/base/l10n/l10n_util_mac.h" |
| 12 #include "ui/base/text/bytes_formatting.h" | 12 #include "ui/base/text/bytes_formatting.h" |
| 13 #include "webkit/appcache/appcache_service.h" | 13 #include "webkit/appcache/appcache_service.h" |
| 14 | 14 |
| 15 #pragma mark Cocoa Cookie Details | 15 #pragma mark Cocoa Cookie Details |
| 16 | 16 |
| 17 @implementation CocoaCookieDetails | 17 @implementation CocoaCookieDetails |
|
michaeln
2011/08/23 20:39:48
Is this really still used now that we have the "we
| |
| 18 | 18 |
| 19 @synthesize canEditExpiration = canEditExpiration_; | 19 @synthesize canEditExpiration = canEditExpiration_; |
| 20 @synthesize hasExpiration = hasExpiration_; | 20 @synthesize hasExpiration = hasExpiration_; |
| 21 @synthesize type = type_; | 21 @synthesize type = type_; |
| 22 | 22 |
| 23 - (BOOL)shouldHideCookieDetailsView { | 23 - (BOOL)shouldHideCookieDetailsView { |
| 24 return type_ != kCocoaCookieDetailsTypeFolder && | 24 return type_ != kCocoaCookieDetailsTypeFolder && |
| 25 type_ != kCocoaCookieDetailsTypeCookie; | 25 type_ != kCocoaCookieDetailsTypeCookie; |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 manifestURL_.reset([base::SysUTF8ToNSString(manifestURL) retain]); | 236 manifestURL_.reset([base::SysUTF8ToNSString(manifestURL) retain]); |
| 237 } | 237 } |
| 238 return self; | 238 return self; |
| 239 } | 239 } |
| 240 | 240 |
| 241 - (id)initWithIndexedDBInfo: | 241 - (id)initWithIndexedDBInfo: |
| 242 (const BrowsingDataIndexedDBHelper::IndexedDBInfo*)indexedDBInfo { | 242 (const BrowsingDataIndexedDBHelper::IndexedDBInfo*)indexedDBInfo { |
| 243 if ((self = [super init])) { | 243 if ((self = [super init])) { |
| 244 type_ = kCocoaCookieDetailsTypeTreeIndexedDB; | 244 type_ = kCocoaCookieDetailsTypeTreeIndexedDB; |
| 245 canEditExpiration_ = NO; | 245 canEditExpiration_ = NO; |
| 246 domain_.reset([base::SysUTF8ToNSString(indexedDBInfo->origin) retain]); | 246 domain_.reset([base::SysUTF8ToNSString( |
| 247 indexedDBInfo->origin_url.spec()) retain]); | |
| 247 fileSize_.reset([base::SysUTF16ToNSString( | 248 fileSize_.reset([base::SysUTF16ToNSString( |
| 248 ui::FormatBytes(indexedDBInfo->size)) retain]); | 249 ui::FormatBytes(indexedDBInfo->size)) retain]); |
| 249 lastModified_.reset([base::SysUTF16ToNSString( | 250 lastModified_.reset([base::SysUTF16ToNSString( |
| 250 base::TimeFormatFriendlyDateAndTime( | 251 base::TimeFormatFriendlyDateAndTime( |
| 251 indexedDBInfo->last_modified)) retain]); | 252 indexedDBInfo->last_modified)) retain]); |
| 252 } | 253 } |
| 253 return self; | 254 return self; |
| 254 } | 255 } |
| 255 | 256 |
| 256 + (CocoaCookieDetails*)createFromCookieTreeNode:(CookieTreeNode*)treeNode { | 257 + (CocoaCookieDetails*)createFromCookieTreeNode:(CookieTreeNode*)treeNode { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 details_.reset([details retain]); | 292 details_.reset([details retain]); |
| 292 } | 293 } |
| 293 return self; | 294 return self; |
| 294 } | 295 } |
| 295 | 296 |
| 296 - (CocoaCookieDetails*)details { | 297 - (CocoaCookieDetails*)details { |
| 297 return details_.get(); | 298 return details_.get(); |
| 298 } | 299 } |
| 299 | 300 |
| 300 @end | 301 @end |
| OLD | NEW |