Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: chrome/browser/ui/webui/cookies_tree_model_util.cc

Issue 1024503002: Add cookies' first-partyness to chrome://settings/cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: How about this? Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/cookie_info_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(kKeySendFor,
129 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_SECURE) : 129 l10n_util::GetStringUTF16(
130 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_ANY)); 130 CookiesTreeModel::GetSendForMessageID(cookie)));
131 std::string accessible = cookie.IsHttpOnly() ? 131 std::string accessible = cookie.IsHttpOnly() ?
132 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_NO) : 132 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_NO) :
133 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_YES); 133 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_ACCESSIBLE_TO_SCRIPT_YES);
134 dict->SetString(kKeyAccessibleToScript, accessible); 134 dict->SetString(kKeyAccessibleToScript, accessible);
135 dict->SetString(kKeyCreated, base::UTF16ToUTF8( 135 dict->SetString(kKeyCreated, base::UTF16ToUTF8(
136 base::TimeFormatFriendlyDateAndTime(cookie.CreationDate()))); 136 base::TimeFormatFriendlyDateAndTime(cookie.CreationDate())));
137 dict->SetString(kKeyExpires, cookie.IsPersistent() ? base::UTF16ToUTF8( 137 dict->SetString(kKeyExpires, cookie.IsPersistent() ? base::UTF16ToUTF8(
138 base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) : 138 base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) :
139 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_EXPIRES_SESSION)); 139 l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_EXPIRES_SESSION));
140 140
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 child = id_map_.Lookup(node_id); 347 child = id_map_.Lookup(node_id);
348 child_index = parent->GetIndexOf(child); 348 child_index = parent->GetIndexOf(child);
349 if (child_index == -1) 349 if (child_index == -1)
350 break; 350 break;
351 351
352 parent = child; 352 parent = child;
353 } 353 }
354 354
355 return child_index >= 0 ? child : NULL; 355 return child_index >= 0 ? child : NULL;
356 } 356 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/cookie_info_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698