| 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" |
| 11 #include "net/cookies/canonical_cookie.h" | 11 #include "net/cookies/canonical_cookie.h" |
| 12 #include "ui/base/l10n/l10n_util_mac.h" | 12 #include "ui/base/l10n/l10n_util_mac.h" |
| 13 #include "ui/base/text/bytes_formatting.h" | 13 #include "ui/base/text/bytes_formatting.h" |
| 14 #include "webkit/browser/appcache/appcache_service.h" | 14 #include "content/public/browser/appcache_service.h" |
| 15 | 15 |
| 16 #pragma mark Cocoa Cookie Details | 16 #pragma mark Cocoa Cookie Details |
| 17 | 17 |
| 18 @implementation CocoaCookieDetails | 18 @implementation CocoaCookieDetails |
| 19 | 19 |
| 20 @synthesize canEditExpiration = canEditExpiration_; | 20 @synthesize canEditExpiration = canEditExpiration_; |
| 21 @synthesize hasExpiration = hasExpiration_; | 21 @synthesize hasExpiration = hasExpiration_; |
| 22 @synthesize type = type_; | 22 @synthesize type = type_; |
| 23 | 23 |
| 24 - (BOOL)shouldHideCookieDetailsView { | 24 - (BOOL)shouldHideCookieDetailsView { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 [base::SysUTF8ToNSString(storageInfo->origin_url.spec()) retain]); | 175 [base::SysUTF8ToNSString(storageInfo->origin_url.spec()) retain]); |
| 176 fileSize_.reset( | 176 fileSize_.reset( |
| 177 [base::SysUTF16ToNSString(ui::FormatBytes(storageInfo->size)) retain]); | 177 [base::SysUTF16ToNSString(ui::FormatBytes(storageInfo->size)) retain]); |
| 178 lastModified_.reset([base::SysUTF16ToNSString( | 178 lastModified_.reset([base::SysUTF16ToNSString( |
| 179 base::TimeFormatFriendlyDateAndTime( | 179 base::TimeFormatFriendlyDateAndTime( |
| 180 storageInfo->last_modified)) retain]); | 180 storageInfo->last_modified)) retain]); |
| 181 } | 181 } |
| 182 return self; | 182 return self; |
| 183 } | 183 } |
| 184 | 184 |
| 185 - (id)initWithAppCacheInfo:(const appcache::AppCacheInfo*)appcacheInfo { | 185 - (id)initWithAppCacheInfo:(const content::AppCacheInfo*)appcacheInfo { |
| 186 if ((self = [super init])) { | 186 if ((self = [super init])) { |
| 187 type_ = kCocoaCookieDetailsTypeTreeAppCache; | 187 type_ = kCocoaCookieDetailsTypeTreeAppCache; |
| 188 canEditExpiration_ = NO; | 188 canEditExpiration_ = NO; |
| 189 manifestURL_.reset([base::SysUTF8ToNSString( | 189 manifestURL_.reset([base::SysUTF8ToNSString( |
| 190 appcacheInfo->manifest_url.spec()) retain]); | 190 appcacheInfo->manifest_url.spec()) retain]); |
| 191 fileSize_.reset([base::SysUTF16ToNSString( | 191 fileSize_.reset([base::SysUTF16ToNSString( |
| 192 ui::FormatBytes(appcacheInfo->size)) retain]); | 192 ui::FormatBytes(appcacheInfo->size)) retain]); |
| 193 created_.reset([base::SysUTF16ToNSString( | 193 created_.reset([base::SysUTF16ToNSString( |
| 194 base::TimeFormatFriendlyDateAndTime( | 194 base::TimeFormatFriendlyDateAndTime( |
| 195 appcacheInfo->creation_time)) retain]); | 195 appcacheInfo->creation_time)) retain]); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |