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

Unified Diff: chrome/browser/ui/webui/cookies_tree_model_util.cc

Issue 7491085: Revert 95607 - Adding usage entry to chrome://settings/cookies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/cookies_tree_model_util.cc
===================================================================
--- chrome/browser/ui/webui/cookies_tree_model_util.cc (revision 95777)
+++ chrome/browser/ui/webui/cookies_tree_model_util.cc (working copy)
@@ -41,13 +41,6 @@
static const char kKeyPersistent[] = "persistent";
static const char kKeyTemporary[] = "temporary";
-static const char kKeyTotalUsage[] = "totalUsage";
-static const char kKeyTemporaryUsage[] = "temporaryUsage";
-static const char kKeyPersistentUsage[] = "persistentUsage";
-static const char kKeyPersistentQuota[] = "persistentQuota";
-
-static const int64 kNegligibleUsage = 1024; // 1KiB
-
// Encodes a pointer value into a hex string.
std::string PointerToHexString(const void* pointer) {
return base::HexEncode(&pointer, sizeof(pointer));
@@ -72,7 +65,7 @@
return PointerToHexString(node);
}
-bool GetCookieTreeNodeDictionary(const CookieTreeNode& node,
+void GetCookieTreeNodeDictionary(const CookieTreeNode& node,
DictionaryValue* dict) {
// Use node's address as an id for WebUI to look it up.
dict->SetString(kKeyId, PointerToHexString(&node));
@@ -197,36 +190,12 @@
IDS_COOKIES_FILE_SYSTEM_USAGE_NONE));
break;
}
- case CookieTreeNode::DetailedInfo::TYPE_QUOTA: {
- dict->SetString(kKeyType, "quota");
- dict->SetString(kKeyIcon, "chrome://theme/IDR_COOKIE_STORAGE_ICON");
-
- const BrowsingDataQuotaHelper::QuotaInfo& quota_info =
- *node.GetDetailedInfo().quota_info;
- if (quota_info.temporary_usage + quota_info.persistent_usage <=
- kNegligibleUsage)
- return false;
-
- dict->SetString(kKeyOrigin, quota_info.host);
- dict->SetString(kKeyTotalUsage,
- UTF16ToUTF8(ui::FormatBytes(
- quota_info.temporary_usage +
- quota_info.persistent_usage)));
- dict->SetString(kKeyTemporaryUsage,
- UTF16ToUTF8(ui::FormatBytes(
- quota_info.temporary_usage)));
- dict->SetString(kKeyPersistentUsage,
- UTF16ToUTF8(ui::FormatBytes(
- quota_info.persistent_usage)));
- break;
- }
default:
#if defined(OS_MACOSX)
dict->SetString(kKeyIcon, "chrome://theme/IDR_BOOKMARK_BAR_FOLDER");
#endif
break;
}
- return true;
}
void GetChildNodeList(CookieTreeNode* parent, int start, int count,
@@ -234,10 +203,8 @@
for (int i = 0; i < count; ++i) {
DictionaryValue* dict = new DictionaryValue;
CookieTreeNode* child = parent->GetChild(start + i);
- if (GetCookieTreeNodeDictionary(*child, dict))
- nodes->Append(dict);
- else
- delete dict;
+ GetCookieTreeNodeDictionary(*child, dict);
+ nodes->Append(dict);
}
}
« no previous file with comments | « chrome/browser/ui/webui/cookies_tree_model_util.h ('k') | chrome/browser/ui/webui/options/cookies_view_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698