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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 case CookieTreeNode::DetailedInfo::TYPE_COOKIE: { | 118 case CookieTreeNode::DetailedInfo::TYPE_COOKIE: { |
119 dict->SetString(kKeyType, "cookie"); | 119 dict->SetString(kKeyType, "cookie"); |
120 dict->SetString(kKeyIcon, "chrome://theme/IDR_COOKIE_ICON"); | 120 dict->SetString(kKeyIcon, "chrome://theme/IDR_COOKIE_ICON"); |
121 | 121 |
122 const net::CanonicalCookie& cookie = *node.GetDetailedInfo().cookie; | 122 const net::CanonicalCookie& cookie = *node.GetDetailedInfo().cookie; |
123 | 123 |
124 dict->SetString(kKeyName, cookie.Name()); | 124 dict->SetString(kKeyName, cookie.Name()); |
125 dict->SetString(kKeyContent, cookie.Value()); | 125 dict->SetString(kKeyContent, cookie.Value()); |
126 dict->SetString(kKeyDomain, cookie.Domain()); | 126 dict->SetString(kKeyDomain, cookie.Domain()); |
127 dict->SetString(kKeyPath, cookie.Path()); | 127 dict->SetString(kKeyPath, cookie.Path()); |
128 dict->SetString(kKeySendFor, cookie.IsSecure() ? | 128 dict->SetString( |
129 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_SECURE) : | 129 kKeySendFor, |
130 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_ANY)); | 130 l10n_util::GetStringUTF16( |
131 cookie.IsSecure() | |
132 ? cookie.IsFirstPartyOnly() | |
133 ? IDS_COOKIES_COOKIE_SENDFOR_SECURE_FIRSTPARTY | |
134 : IDS_COOKIES_COOKIE_SENDFOR_SECURE | |
135 : cookie.IsFirstPartyOnly() | |
136 ? IDS_COOKIES_COOKIE_SENDFOR_FIRSTPARTY | |
137 : IDS_COOKIES_COOKIE_SENDFOR_ANY)); | |
Pam (message me for reviews)
2015/03/20 10:30:39
same here, more so
| |
131 std::string accessible = cookie.IsHttpOnly() ? | 138 std::string accessible = cookie.IsHttpOnly() ? |
132 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_NO) : | 139 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_NO) : |
133 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_YES); | 140 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_YES); |
134 dict->SetString(kKeyAccessibleToScript, accessible); | 141 dict->SetString(kKeyAccessibleToScript, accessible); |
135 dict->SetString(kKeyCreated, base::UTF16ToUTF8( | 142 dict->SetString(kKeyCreated, base::UTF16ToUTF8( |
136 base::TimeFormatFriendlyDateAndTime(cookie.CreationDate()))); | 143 base::TimeFormatFriendlyDateAndTime(cookie.CreationDate()))); |
137 dict->SetString(kKeyExpires, cookie.IsPersistent() ? base::UTF16ToUTF8( | 144 dict->SetString(kKeyExpires, cookie.IsPersistent() ? base::UTF16ToUTF8( |
138 base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) : | 145 base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) : |
139 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_EXPIRES_SESSION)); | 146 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_EXPIRES_SESSION)); |
140 | 147 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
347 child = id_map_.Lookup(node_id); | 354 child = id_map_.Lookup(node_id); |
348 child_index = parent->GetIndexOf(child); | 355 child_index = parent->GetIndexOf(child); |
349 if (child_index == -1) | 356 if (child_index == -1) |
350 break; | 357 break; |
351 | 358 |
352 parent = child; | 359 parent = child; |
353 } | 360 } |
354 | 361 |
355 return child_index >= 0 ? child : NULL; | 362 return child_index >= 0 ? child : NULL; |
356 } | 363 } |
OLD | NEW |