| 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 "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 expires_.reset([base::SysUTF16ToNSString( | 140 expires_.reset([base::SysUTF16ToNSString( |
| 141 base::TimeFormatFriendlyDateAndTime(cookie->ExpiryDate())) retain]); | 141 base::TimeFormatFriendlyDateAndTime(cookie->ExpiryDate())) retain]); |
| 142 } else { | 142 } else { |
| 143 expires_.reset([l10n_util::GetNSStringWithFixup( | 143 expires_.reset([l10n_util::GetNSStringWithFixup( |
| 144 IDS_COOKIES_COOKIE_EXPIRES_SESSION) retain]); | 144 IDS_COOKIES_COOKIE_EXPIRES_SESSION) retain]); |
| 145 } | 145 } |
| 146 | 146 |
| 147 created_.reset([base::SysUTF16ToNSString( | 147 created_.reset([base::SysUTF16ToNSString( |
| 148 base::TimeFormatFriendlyDateAndTime(cookie->CreationDate())) retain]); | 148 base::TimeFormatFriendlyDateAndTime(cookie->CreationDate())) retain]); |
| 149 | 149 |
| 150 if (cookie->IsSecure()) { | 150 sendFor_.reset([l10n_util::GetNSStringWithFixup( |
| 151 sendFor_.reset([l10n_util::GetNSStringWithFixup( | 151 CookiesTreeModel::GetSendForMessageID(*cookie)) retain]); |
| 152 IDS_COOKIES_COOKIE_SENDFOR_SECURE) retain]); | |
| 153 } else { | |
| 154 sendFor_.reset([l10n_util::GetNSStringWithFixup( | |
| 155 IDS_COOKIES_COOKIE_SENDFOR_ANY) retain]); | |
| 156 } | |
| 157 } | 152 } |
| 158 return self; | 153 return self; |
| 159 } | 154 } |
| 160 | 155 |
| 161 - (id)initWithDatabase:(const BrowsingDataDatabaseHelper::DatabaseInfo*) | 156 - (id)initWithDatabase:(const BrowsingDataDatabaseHelper::DatabaseInfo*) |
| 162 databaseInfo { | 157 databaseInfo { |
| 163 if ((self = [super init])) { | 158 if ((self = [super init])) { |
| 164 type_ = kCocoaCookieDetailsTypeTreeDatabase; | 159 type_ = kCocoaCookieDetailsTypeTreeDatabase; |
| 165 canEditExpiration_ = NO; | 160 canEditExpiration_ = NO; |
| 166 databaseDescription_.reset([base::SysUTF8ToNSString( | 161 databaseDescription_.reset([base::SysUTF8ToNSString( |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 details_.reset([details retain]); | 318 details_.reset([details retain]); |
| 324 } | 319 } |
| 325 return self; | 320 return self; |
| 326 } | 321 } |
| 327 | 322 |
| 328 - (CocoaCookieDetails*)details { | 323 - (CocoaCookieDetails*)details { |
| 329 return details_.get(); | 324 return details_.get(); |
| 330 } | 325 } |
| 331 | 326 |
| 332 @end | 327 @end |
| OLD | NEW |