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/webui/cookies_tree_model_util.h" | 5 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 dict->SetString(kKeyPath, cookie.Path()); | 112 dict->SetString(kKeyPath, cookie.Path()); |
113 dict->SetString(kKeySendFor, cookie.IsSecure() ? | 113 dict->SetString(kKeySendFor, cookie.IsSecure() ? |
114 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_SECURE) : | 114 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_SECURE) : |
115 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_ANY)); | 115 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_ANY)); |
116 std::string accessible = cookie.IsHttpOnly() ? | 116 std::string accessible = cookie.IsHttpOnly() ? |
117 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_NO) : | 117 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_NO) : |
118 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_YES); | 118 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_YES); |
119 dict->SetString(kKeyAccessibleToScript, accessible); | 119 dict->SetString(kKeyAccessibleToScript, accessible); |
120 dict->SetString(kKeyCreated, UTF16ToUTF8( | 120 dict->SetString(kKeyCreated, UTF16ToUTF8( |
121 base::TimeFormatFriendlyDateAndTime(cookie.CreationDate()))); | 121 base::TimeFormatFriendlyDateAndTime(cookie.CreationDate()))); |
122 dict->SetString(kKeyExpires, cookie.DoesExpire() ? UTF16ToUTF8( | 122 dict->SetString(kKeyExpires, cookie.IsPersistent() ? UTF16ToUTF8( |
123 base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) : | 123 base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) : |
124 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_EXPIRES_SESSION)); | 124 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_EXPIRES_SESSION)); |
125 | 125 |
126 break; | 126 break; |
127 } | 127 } |
128 case CookieTreeNode::DetailedInfo::TYPE_DATABASE: { | 128 case CookieTreeNode::DetailedInfo::TYPE_DATABASE: { |
129 dict->SetString(kKeyType, "database"); | 129 dict->SetString(kKeyType, "database"); |
130 dict->SetString(kKeyIcon, "chrome://theme/IDR_COOKIE_STORAGE_ICON"); | 130 dict->SetString(kKeyIcon, "chrome://theme/IDR_COOKIE_STORAGE_ICON"); |
131 | 131 |
132 const BrowsingDataDatabaseHelper::DatabaseInfo& database_info = | 132 const BrowsingDataDatabaseHelper::DatabaseInfo& database_info = |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 child = id_map_.Lookup(node_id); | 290 child = id_map_.Lookup(node_id); |
291 child_index = parent->GetIndexOf(child); | 291 child_index = parent->GetIndexOf(child); |
292 if (child_index == -1) | 292 if (child_index == -1) |
293 break; | 293 break; |
294 | 294 |
295 parent = child; | 295 parent = child; |
296 } | 296 } |
297 | 297 |
298 return child_index >= 0 ? child : NULL; | 298 return child_index >= 0 ? child : NULL; |
299 } | 299 } |
OLD | NEW |