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

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

Issue 10709006: Show apps protecting local data in chrome://settings/cookies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 5 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
diff --git a/chrome/browser/ui/webui/cookies_tree_model_util.cc b/chrome/browser/ui/webui/cookies_tree_model_util.cc
index 318148d50d7a376136ba0ef8f04a26b641f801a9..e43de3f1f31a99b523a86b1421df34c33f374611 100644
--- a/chrome/browser/ui/webui/cookies_tree_model_util.cc
+++ b/chrome/browser/ui/webui/cookies_tree_model_util.cc
@@ -25,6 +25,7 @@ const char kKeyIcon[] = "icon";
const char kKeyType[] = "type";
const char kKeyHasChildren[] = "hasChildren";
+const char kKeyProtectedByApps[] = "protectedByApps";
Evan Stade 2012/07/10 07:53:08 these keys need documentation. And this key in par
Bernhard Bauer 2012/07/10 09:50:59 Done.
const char kKeyName[] = "name";
const char kKeyContent[] = "content";
const char kKeyDomain[] = "domain";
@@ -92,7 +93,7 @@ bool CookiesTreeModelUtil::GetCookieTreeNodeDictionary(
dict->SetBoolean(kKeyHasChildren, !node.empty());
switch (node.GetDetailedInfo().node_type) {
- case CookieTreeNode::DetailedInfo::TYPE_ORIGIN: {
+ case CookieTreeNode::DetailedInfo::TYPE_HOST: {
dict->SetString(kKeyType, "origin");
#if defined(OS_MACOSX)
dict->SetString(kKeyIcon, "chrome://theme/IDR_BOOKMARK_BAR_FOLDER");
@@ -256,6 +257,20 @@ bool CookiesTreeModelUtil::GetCookieTreeNodeDictionary(
#endif
break;
}
Evan Stade 2012/07/10 07:53:08 \n
Bernhard Bauer 2012/07/10 09:50:59 Done.
+ const ExtensionSet* protecting_apps =
+ node.GetModel()->ExtensionsProtectingNode(node);
+ if (protecting_apps && !protecting_apps->is_empty()) {
+ base::ListValue* app_infos = new base::ListValue;
+ for (ExtensionSet::const_iterator it =
Evan Stade 2012/07/10 07:53:08 is this newline necessary?
Bernhard Bauer 2012/07/10 09:50:59 No. Removed.
+ protecting_apps->begin();
+ it != protecting_apps->end(); ++it) {
+ base::DictionaryValue* app_info = new base::DictionaryValue();
+ app_info->SetString(kKeyId, (*it)->id());
+ app_info->SetString(kKeyName, (*it)->name());
+ app_infos->Append(app_info);
+ }
+ dict->Set(kKeyProtectedByApps, app_infos);
+ }
Evan Stade 2012/07/10 07:53:08 \n
Bernhard Bauer 2012/07/10 09:50:59 Done.
return true;
}

Powered by Google App Engine
This is Rietveld 408576698