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

Side by Side Diff: chrome/browser/browsing_data/cookies_tree_model.cc

Issue 356713005: Rename ServerBoundCert => ChannelID to reflect the current name (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix cookies_list.js Created 6 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 unified diff | Download patch | Annotate | Revision Log
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/browsing_data/cookies_tree_model.h" 5 #include "chrome/browser/browsing_data/cookies_tree_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/memory/linked_ptr.h" 12 #include "base/memory/linked_ptr.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h"
15 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" 16 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h"
16 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" 17 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h"
17 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h"
18 #include "chrome/browser/content_settings/cookie_settings.h" 18 #include "chrome/browser/content_settings/cookie_settings.h"
19 #include "chrome/browser/extensions/extension_service.h" 19 #include "chrome/browser/extensions/extension_service.h"
20 #include "chrome/browser/extensions/extension_special_storage_policy.h" 20 #include "chrome/browser/extensions/extension_special_storage_policy.h"
21 #include "content/public/common/url_constants.h" 21 #include "content/public/common/url_constants.h"
22 #include "extensions/common/extension_set.h" 22 #include "extensions/common/extension_set.h"
23 #include "grit/generated_resources.h" 23 #include "grit/generated_resources.h"
24 #include "grit/theme_resources.h" 24 #include "grit/theme_resources.h"
25 #include "grit/ui_resources.h" 25 #include "grit/ui_resources.h"
26 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 26 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
27 #include "net/cookies/canonical_cookie.h" 27 #include "net/cookies/canonical_cookie.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 case CookieTreeNode::DetailedInfo::TYPE_SESSION_STORAGE: 122 case CookieTreeNode::DetailedInfo::TYPE_SESSION_STORAGE:
123 return true; 123 return true;
124 case CookieTreeNode::DetailedInfo::TYPE_APPCACHE: 124 case CookieTreeNode::DetailedInfo::TYPE_APPCACHE:
125 return true; 125 return true;
126 case CookieTreeNode::DetailedInfo::TYPE_INDEXED_DB: 126 case CookieTreeNode::DetailedInfo::TYPE_INDEXED_DB:
127 return true; 127 return true;
128 case CookieTreeNode::DetailedInfo::TYPE_FILE_SYSTEM: 128 case CookieTreeNode::DetailedInfo::TYPE_FILE_SYSTEM:
129 return true; 129 return true;
130 case CookieTreeNode::DetailedInfo::TYPE_QUOTA: 130 case CookieTreeNode::DetailedInfo::TYPE_QUOTA:
131 return false; 131 return false;
132 case CookieTreeNode::DetailedInfo::TYPE_SERVER_BOUND_CERT: 132 case CookieTreeNode::DetailedInfo::TYPE_CHANNEL_ID:
133 return false; 133 return false;
134 case CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO: 134 case CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO:
135 return false; 135 return false;
136 default: 136 default:
137 break; 137 break;
138 } 138 }
139 return false; 139 return false;
140 } 140 }
141 141
142 // This function returns the local data container associated with a leaf tree 142 // This function returns the local data container associated with a leaf tree
(...skipping 13 matching lines...) Expand all
156 CookieTreeNode::DetailedInfo::DetailedInfo() 156 CookieTreeNode::DetailedInfo::DetailedInfo()
157 : node_type(TYPE_NONE), 157 : node_type(TYPE_NONE),
158 cookie(NULL), 158 cookie(NULL),
159 database_info(NULL), 159 database_info(NULL),
160 local_storage_info(NULL), 160 local_storage_info(NULL),
161 session_storage_info(NULL), 161 session_storage_info(NULL),
162 appcache_info(NULL), 162 appcache_info(NULL),
163 indexed_db_info(NULL), 163 indexed_db_info(NULL),
164 file_system_info(NULL), 164 file_system_info(NULL),
165 quota_info(NULL), 165 quota_info(NULL),
166 server_bound_cert(NULL) {} 166 channel_id(NULL) {}
167 167
168 CookieTreeNode::DetailedInfo::~DetailedInfo() {} 168 CookieTreeNode::DetailedInfo::~DetailedInfo() {}
169 169
170 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::Init( 170 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::Init(
171 NodeType type) { 171 NodeType type) {
172 DCHECK_EQ(TYPE_NONE, node_type); 172 DCHECK_EQ(TYPE_NONE, node_type);
173 node_type = type; 173 node_type = type;
174 return *this; 174 return *this;
175 } 175 }
176 176
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 return *this; 237 return *this;
238 } 238 }
239 239
240 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitQuota( 240 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitQuota(
241 const BrowsingDataQuotaHelper::QuotaInfo* quota_info) { 241 const BrowsingDataQuotaHelper::QuotaInfo* quota_info) {
242 Init(TYPE_QUOTA); 242 Init(TYPE_QUOTA);
243 this->quota_info = quota_info; 243 this->quota_info = quota_info;
244 return *this; 244 return *this;
245 } 245 }
246 246
247 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitServerBoundCert( 247 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitChannelID(
248 const net::ServerBoundCertStore::ServerBoundCert* server_bound_cert) { 248 const net::ChannelIDStore::ChannelID* channel_id) {
249 Init(TYPE_SERVER_BOUND_CERT); 249 Init(TYPE_CHANNEL_ID);
250 this->server_bound_cert = server_bound_cert; 250 this->channel_id = channel_id;
251 return *this; 251 return *this;
252 } 252 }
253 253
254 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitFlashLSO( 254 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitFlashLSO(
255 const std::string& flash_lso_domain) { 255 const std::string& flash_lso_domain) {
256 Init(TYPE_FLASH_LSO); 256 Init(TYPE_FLASH_LSO);
257 this->flash_lso_domain = flash_lso_domain; 257 this->flash_lso_domain = flash_lso_domain;
258 return *this; 258 return *this;
259 } 259 }
260 260
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 container->quota_helper_->RevokeHostQuota(quota_info_->host); 484 container->quota_helper_->RevokeHostQuota(quota_info_->host);
485 container->quota_info_list_.erase(quota_info_); 485 container->quota_info_list_.erase(quota_info_);
486 } 486 }
487 } 487 }
488 488
489 CookieTreeNode::DetailedInfo CookieTreeQuotaNode::GetDetailedInfo() const { 489 CookieTreeNode::DetailedInfo CookieTreeQuotaNode::GetDetailedInfo() const {
490 return DetailedInfo().InitQuota(&*quota_info_); 490 return DetailedInfo().InitQuota(&*quota_info_);
491 } 491 }
492 492
493 /////////////////////////////////////////////////////////////////////////////// 493 ///////////////////////////////////////////////////////////////////////////////
494 // CookieTreeServerBoundCertNode, public: 494 // CookieTreeChannelIDNode, public:
495 495
496 CookieTreeServerBoundCertNode::CookieTreeServerBoundCertNode( 496 CookieTreeChannelIDNode::CookieTreeChannelIDNode(
497 net::ServerBoundCertStore::ServerBoundCertList::iterator cert) 497 net::ChannelIDStore::ChannelIDList::iterator channel_id)
498 : CookieTreeNode(base::ASCIIToUTF16(cert->server_identifier())), 498 : CookieTreeNode(base::ASCIIToUTF16(channel_id->server_identifier())),
499 server_bound_cert_(cert) { 499 channel_id_(channel_id) {
500 } 500 }
501 501
502 CookieTreeServerBoundCertNode::~CookieTreeServerBoundCertNode() {} 502 CookieTreeChannelIDNode::~CookieTreeChannelIDNode() {}
503 503
504 void CookieTreeServerBoundCertNode::DeleteStoredObjects() { 504 void CookieTreeChannelIDNode::DeleteStoredObjects() {
505 LocalDataContainer* container = GetLocalDataContainerForNode(this); 505 LocalDataContainer* container = GetLocalDataContainerForNode(this);
506 506
507 if (container) { 507 if (container) {
508 container->server_bound_cert_helper_->DeleteServerBoundCert( 508 container->channel_id_helper_->DeleteChannelID(
509 server_bound_cert_->server_identifier()); 509 channel_id_->server_identifier());
510 container->server_bound_cert_list_.erase(server_bound_cert_); 510 container->channel_id_list_.erase(channel_id_);
511 } 511 }
512 } 512 }
513 513
514 CookieTreeNode::DetailedInfo 514 CookieTreeNode::DetailedInfo
515 CookieTreeServerBoundCertNode::GetDetailedInfo() const { 515 CookieTreeChannelIDNode::GetDetailedInfo() const {
516 return DetailedInfo().InitServerBoundCert(&*server_bound_cert_); 516 return DetailedInfo().InitChannelID(&*channel_id_);
517 } 517 }
518 518
519 /////////////////////////////////////////////////////////////////////////////// 519 ///////////////////////////////////////////////////////////////////////////////
520 // CookieTreeRootNode, public: 520 // CookieTreeRootNode, public:
521 521
522 CookieTreeRootNode::CookieTreeRootNode(CookiesTreeModel* model) 522 CookieTreeRootNode::CookieTreeRootNode(CookiesTreeModel* model)
523 : model_(model) { 523 : model_(model) {
524 } 524 }
525 525
526 CookieTreeRootNode::~CookieTreeRootNode() {} 526 CookieTreeRootNode::~CookieTreeRootNode() {}
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 CookieTreeHostNode::CookieTreeHostNode(const GURL& url) 567 CookieTreeHostNode::CookieTreeHostNode(const GURL& url)
568 : CookieTreeNode(TitleForUrl(url)), 568 : CookieTreeNode(TitleForUrl(url)),
569 cookies_child_(NULL), 569 cookies_child_(NULL),
570 databases_child_(NULL), 570 databases_child_(NULL),
571 local_storages_child_(NULL), 571 local_storages_child_(NULL),
572 session_storages_child_(NULL), 572 session_storages_child_(NULL),
573 appcaches_child_(NULL), 573 appcaches_child_(NULL),
574 indexed_dbs_child_(NULL), 574 indexed_dbs_child_(NULL),
575 file_systems_child_(NULL), 575 file_systems_child_(NULL),
576 quota_child_(NULL), 576 quota_child_(NULL),
577 server_bound_certs_child_(NULL), 577 channel_ids_child_(NULL),
578 flash_lso_child_(NULL), 578 flash_lso_child_(NULL),
579 url_(url), 579 url_(url),
580 canonicalized_host_(CanonicalizeHost(url)) {} 580 canonicalized_host_(CanonicalizeHost(url)) {}
581 581
582 CookieTreeHostNode::~CookieTreeHostNode() {} 582 CookieTreeHostNode::~CookieTreeHostNode() {}
583 583
584 const std::string CookieTreeHostNode::GetHost() const { 584 const std::string CookieTreeHostNode::GetHost() const {
585 const std::string file_origin_node_name( 585 const std::string file_origin_node_name(
586 std::string(url::kFileScheme) + url::kStandardSchemeSeparator); 586 std::string(url::kFileScheme) + url::kStandardSchemeSeparator);
587 return url_.SchemeIsFile() ? file_origin_node_name : url_.host(); 587 return url_.SchemeIsFile() ? file_origin_node_name : url_.host();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 651
652 CookieTreeQuotaNode* CookieTreeHostNode::UpdateOrCreateQuotaNode( 652 CookieTreeQuotaNode* CookieTreeHostNode::UpdateOrCreateQuotaNode(
653 std::list<BrowsingDataQuotaHelper::QuotaInfo>::iterator quota_info) { 653 std::list<BrowsingDataQuotaHelper::QuotaInfo>::iterator quota_info) {
654 if (quota_child_) 654 if (quota_child_)
655 return quota_child_; 655 return quota_child_;
656 quota_child_ = new CookieTreeQuotaNode(quota_info); 656 quota_child_ = new CookieTreeQuotaNode(quota_info);
657 AddChildSortedByTitle(quota_child_); 657 AddChildSortedByTitle(quota_child_);
658 return quota_child_; 658 return quota_child_;
659 } 659 }
660 660
661 CookieTreeServerBoundCertsNode* 661 CookieTreeChannelIDsNode*
662 CookieTreeHostNode::GetOrCreateServerBoundCertsNode() { 662 CookieTreeHostNode::GetOrCreateChannelIDsNode() {
663 if (server_bound_certs_child_) 663 if (channel_ids_child_)
664 return server_bound_certs_child_; 664 return channel_ids_child_;
665 server_bound_certs_child_ = new CookieTreeServerBoundCertsNode; 665 channel_ids_child_ = new CookieTreeChannelIDsNode;
666 AddChildSortedByTitle(server_bound_certs_child_); 666 AddChildSortedByTitle(channel_ids_child_);
667 return server_bound_certs_child_; 667 return channel_ids_child_;
668 } 668 }
669 669
670 CookieTreeFlashLSONode* CookieTreeHostNode::GetOrCreateFlashLSONode( 670 CookieTreeFlashLSONode* CookieTreeHostNode::GetOrCreateFlashLSONode(
671 const std::string& domain) { 671 const std::string& domain) {
672 DCHECK_EQ(GetHost(), domain); 672 DCHECK_EQ(GetHost(), domain);
673 if (flash_lso_child_) 673 if (flash_lso_child_)
674 return flash_lso_child_; 674 return flash_lso_child_;
675 flash_lso_child_ = new CookieTreeFlashLSONode(domain); 675 flash_lso_child_ = new CookieTreeFlashLSONode(domain);
676 AddChildSortedByTitle(flash_lso_child_); 676 AddChildSortedByTitle(flash_lso_child_);
677 return flash_lso_child_; 677 return flash_lso_child_;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 } 787 }
788 788
789 CookieTreeFileSystemsNode::~CookieTreeFileSystemsNode() {} 789 CookieTreeFileSystemsNode::~CookieTreeFileSystemsNode() {}
790 790
791 CookieTreeNode::DetailedInfo 791 CookieTreeNode::DetailedInfo
792 CookieTreeFileSystemsNode::GetDetailedInfo() const { 792 CookieTreeFileSystemsNode::GetDetailedInfo() const {
793 return DetailedInfo().Init(DetailedInfo::TYPE_FILE_SYSTEMS); 793 return DetailedInfo().Init(DetailedInfo::TYPE_FILE_SYSTEMS);
794 } 794 }
795 795
796 /////////////////////////////////////////////////////////////////////////////// 796 ///////////////////////////////////////////////////////////////////////////////
797 // CookieTreeServerBoundCertsNode, public: 797 // CookieTreeChannelIDsNode, public:
798 798
799 CookieTreeServerBoundCertsNode::CookieTreeServerBoundCertsNode() 799 CookieTreeChannelIDsNode::CookieTreeChannelIDsNode()
800 : CookieTreeNode( 800 : CookieTreeNode(
801 l10n_util::GetStringUTF16(IDS_COOKIES_SERVER_BOUND_CERTS)) { 801 l10n_util::GetStringUTF16(IDS_COOKIES_CHANNEL_IDS)) {
802 } 802 }
803 803
804 CookieTreeServerBoundCertsNode::~CookieTreeServerBoundCertsNode() {} 804 CookieTreeChannelIDsNode::~CookieTreeChannelIDsNode() {}
805 805
806 CookieTreeNode::DetailedInfo 806 CookieTreeNode::DetailedInfo
807 CookieTreeServerBoundCertsNode::GetDetailedInfo() const { 807 CookieTreeChannelIDsNode::GetDetailedInfo() const {
808 return DetailedInfo().Init(DetailedInfo::TYPE_SERVER_BOUND_CERTS); 808 return DetailedInfo().Init(DetailedInfo::TYPE_CHANNEL_IDS);
809 } 809 }
810 810
811 void CookieTreeNode::AddChildSortedByTitle(CookieTreeNode* new_child) { 811 void CookieTreeNode::AddChildSortedByTitle(CookieTreeNode* new_child) {
812 DCHECK(new_child); 812 DCHECK(new_child);
813 std::vector<CookieTreeNode*>::iterator iter = 813 std::vector<CookieTreeNode*>::iterator iter =
814 std::lower_bound(children().begin(), children().end(), new_child, 814 std::lower_bound(children().begin(), children().end(), new_child,
815 NodeTitleComparator()); 815 NodeTitleComparator());
816 GetModel()->Add(this, new_child, iter - children().begin()); 816 GetModel()->Add(this, new_child, iter - children().begin());
817 } 817 }
818 818
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 case CookieTreeNode::DetailedInfo::TYPE_SESSION_STORAGE: 908 case CookieTreeNode::DetailedInfo::TYPE_SESSION_STORAGE:
909 return DATABASE; // ditto 909 return DATABASE; // ditto
910 case CookieTreeNode::DetailedInfo::TYPE_APPCACHE: 910 case CookieTreeNode::DetailedInfo::TYPE_APPCACHE:
911 return DATABASE; // ditto 911 return DATABASE; // ditto
912 case CookieTreeNode::DetailedInfo::TYPE_INDEXED_DB: 912 case CookieTreeNode::DetailedInfo::TYPE_INDEXED_DB:
913 return DATABASE; // ditto 913 return DATABASE; // ditto
914 case CookieTreeNode::DetailedInfo::TYPE_FILE_SYSTEM: 914 case CookieTreeNode::DetailedInfo::TYPE_FILE_SYSTEM:
915 return DATABASE; // ditto 915 return DATABASE; // ditto
916 case CookieTreeNode::DetailedInfo::TYPE_QUOTA: 916 case CookieTreeNode::DetailedInfo::TYPE_QUOTA:
917 return -1; 917 return -1;
918 case CookieTreeNode::DetailedInfo::TYPE_SERVER_BOUND_CERT: 918 case CookieTreeNode::DetailedInfo::TYPE_CHANNEL_ID:
919 return COOKIE; // It's kinda like a cookie? 919 return COOKIE; // It's kinda like a cookie?
920 default: 920 default:
921 break; 921 break;
922 } 922 }
923 return -1; 923 return -1;
924 } 924 }
925 925
926 void CookiesTreeModel::DeleteAllStoredObjects() { 926 void CookiesTreeModel::DeleteAllStoredObjects() {
927 NotifyObserverBeginBatch(); 927 NotifyObserverBeginBatch();
928 CookieTreeNode* root = GetRoot(); 928 CookieTreeNode* root = GetRoot();
(...skipping 24 matching lines...) Expand all
953 delete Remove(root, root->GetChild(i)); 953 delete Remove(root, root->GetChild(i));
954 954
955 PopulateCookieInfoWithFilter(data_container(), &notifier, filter); 955 PopulateCookieInfoWithFilter(data_container(), &notifier, filter);
956 PopulateDatabaseInfoWithFilter(data_container(), &notifier, filter); 956 PopulateDatabaseInfoWithFilter(data_container(), &notifier, filter);
957 PopulateLocalStorageInfoWithFilter(data_container(), &notifier, filter); 957 PopulateLocalStorageInfoWithFilter(data_container(), &notifier, filter);
958 PopulateSessionStorageInfoWithFilter(data_container(), &notifier, filter); 958 PopulateSessionStorageInfoWithFilter(data_container(), &notifier, filter);
959 PopulateAppCacheInfoWithFilter(data_container(), &notifier, filter); 959 PopulateAppCacheInfoWithFilter(data_container(), &notifier, filter);
960 PopulateIndexedDBInfoWithFilter(data_container(), &notifier, filter); 960 PopulateIndexedDBInfoWithFilter(data_container(), &notifier, filter);
961 PopulateFileSystemInfoWithFilter(data_container(), &notifier, filter); 961 PopulateFileSystemInfoWithFilter(data_container(), &notifier, filter);
962 PopulateQuotaInfoWithFilter(data_container(), &notifier, filter); 962 PopulateQuotaInfoWithFilter(data_container(), &notifier, filter);
963 PopulateServerBoundCertInfoWithFilter(data_container(), &notifier, filter); 963 PopulateChannelIDInfoWithFilter(data_container(), &notifier, filter);
964 } 964 }
965 965
966 const extensions::ExtensionSet* CookiesTreeModel::ExtensionsProtectingNode( 966 const extensions::ExtensionSet* CookiesTreeModel::ExtensionsProtectingNode(
967 const CookieTreeNode& cookie_node) { 967 const CookieTreeNode& cookie_node) {
968 if (!special_storage_policy_.get()) 968 if (!special_storage_policy_.get())
969 return NULL; 969 return NULL;
970 970
971 CookieTreeNode::DetailedInfo info = cookie_node.GetDetailedInfo(); 971 CookieTreeNode::DetailedInfo info = cookie_node.GetDetailedInfo();
972 972
973 if (!TypeIsProtected(info.node_type)) 973 if (!TypeIsProtected(info.node_type))
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 void CookiesTreeModel::PopulateFileSystemInfo(LocalDataContainer* container) { 1023 void CookiesTreeModel::PopulateFileSystemInfo(LocalDataContainer* container) {
1024 ScopedBatchUpdateNotifier notifier(this, GetRoot()); 1024 ScopedBatchUpdateNotifier notifier(this, GetRoot());
1025 PopulateFileSystemInfoWithFilter(container, &notifier, base::string16()); 1025 PopulateFileSystemInfoWithFilter(container, &notifier, base::string16());
1026 } 1026 }
1027 1027
1028 void CookiesTreeModel::PopulateQuotaInfo(LocalDataContainer* container) { 1028 void CookiesTreeModel::PopulateQuotaInfo(LocalDataContainer* container) {
1029 ScopedBatchUpdateNotifier notifier(this, GetRoot()); 1029 ScopedBatchUpdateNotifier notifier(this, GetRoot());
1030 PopulateQuotaInfoWithFilter(container, &notifier, base::string16()); 1030 PopulateQuotaInfoWithFilter(container, &notifier, base::string16());
1031 } 1031 }
1032 1032
1033 void CookiesTreeModel::PopulateServerBoundCertInfo( 1033 void CookiesTreeModel::PopulateChannelIDInfo(
1034 LocalDataContainer* container) { 1034 LocalDataContainer* container) {
1035 ScopedBatchUpdateNotifier notifier(this, GetRoot()); 1035 ScopedBatchUpdateNotifier notifier(this, GetRoot());
1036 PopulateServerBoundCertInfoWithFilter(container, &notifier, base::string16()); 1036 PopulateChannelIDInfoWithFilter(container, &notifier, base::string16());
1037 } 1037 }
1038 1038
1039 void CookiesTreeModel::PopulateFlashLSOInfo( 1039 void CookiesTreeModel::PopulateFlashLSOInfo(
1040 LocalDataContainer* container) { 1040 LocalDataContainer* container) {
1041 ScopedBatchUpdateNotifier notifier(this, GetRoot()); 1041 ScopedBatchUpdateNotifier notifier(this, GetRoot());
1042 PopulateFlashLSOInfoWithFilter(container, &notifier, base::string16()); 1042 PopulateFlashLSOInfoWithFilter(container, &notifier, base::string16());
1043 } 1043 }
1044 1044
1045 void CookiesTreeModel::PopulateAppCacheInfoWithFilter( 1045 void CookiesTreeModel::PopulateAppCacheInfoWithFilter(
1046 LocalDataContainer* container, 1046 LocalDataContainer* container,
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 base::string16::npos)) { 1210 base::string16::npos)) {
1211 CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin); 1211 CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin);
1212 CookieTreeIndexedDBsNode* indexed_dbs_node = 1212 CookieTreeIndexedDBsNode* indexed_dbs_node =
1213 host_node->GetOrCreateIndexedDBsNode(); 1213 host_node->GetOrCreateIndexedDBsNode();
1214 indexed_dbs_node->AddIndexedDBNode( 1214 indexed_dbs_node->AddIndexedDBNode(
1215 new CookieTreeIndexedDBNode(indexed_db_info)); 1215 new CookieTreeIndexedDBNode(indexed_db_info));
1216 } 1216 }
1217 } 1217 }
1218 } 1218 }
1219 1219
1220 void CookiesTreeModel::PopulateServerBoundCertInfoWithFilter( 1220 void CookiesTreeModel::PopulateChannelIDInfoWithFilter(
1221 LocalDataContainer* container, 1221 LocalDataContainer* container,
1222 ScopedBatchUpdateNotifier* notifier, 1222 ScopedBatchUpdateNotifier* notifier,
1223 const base::string16& filter) { 1223 const base::string16& filter) {
1224 CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); 1224 CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot());
1225 1225
1226 if (container->server_bound_cert_list_.empty()) 1226 if (container->channel_id_list_.empty())
1227 return; 1227 return;
1228 1228
1229 notifier->StartBatchUpdate(); 1229 notifier->StartBatchUpdate();
1230 for (ServerBoundCertList::iterator cert_info = 1230 for (ChannelIDList::iterator channel_id_info =
1231 container->server_bound_cert_list_.begin(); 1231 container->channel_id_list_.begin();
1232 cert_info != container->server_bound_cert_list_.end(); 1232 channel_id_info != container->channel_id_list_.end();
1233 ++cert_info) { 1233 ++channel_id_info) {
1234 GURL origin(cert_info->server_identifier()); 1234 GURL origin(channel_id_info->server_identifier());
1235 if (!origin.is_valid()) { 1235 if (!origin.is_valid()) {
1236 // Domain Bound Cert. Make a valid URL to satisfy the 1236 // Channel ID. Make a valid URL to satisfy the
1237 // CookieTreeRootNode::GetOrCreateHostNode interface. 1237 // CookieTreeRootNode::GetOrCreateHostNode interface.
1238 origin = GURL(std::string(url::kHttpsScheme) + 1238 origin = GURL(std::string(url::kHttpsScheme) +
1239 url::kStandardSchemeSeparator + 1239 url::kStandardSchemeSeparator +
1240 cert_info->server_identifier() + "/"); 1240 channel_id_info->server_identifier() + "/");
1241 } 1241 }
1242 base::string16 title = CookieTreeHostNode::TitleForUrl(origin); 1242 base::string16 title = CookieTreeHostNode::TitleForUrl(origin);
1243 if (!filter.size() || title.find(filter) != base::string16::npos) { 1243 if (!filter.size() || title.find(filter) != base::string16::npos) {
1244 CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin); 1244 CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin);
1245 CookieTreeServerBoundCertsNode* server_bound_certs_node = 1245 CookieTreeChannelIDsNode* channel_ids_node =
1246 host_node->GetOrCreateServerBoundCertsNode(); 1246 host_node->GetOrCreateChannelIDsNode();
1247 server_bound_certs_node->AddServerBoundCertNode( 1247 channel_ids_node->AddChannelIDNode(
1248 new CookieTreeServerBoundCertNode(cert_info)); 1248 new CookieTreeChannelIDNode(channel_id_info));
1249 } 1249 }
1250 } 1250 }
1251 } 1251 }
1252 1252
1253 void CookiesTreeModel::PopulateFileSystemInfoWithFilter( 1253 void CookiesTreeModel::PopulateFileSystemInfoWithFilter(
1254 LocalDataContainer* container, 1254 LocalDataContainer* container,
1255 ScopedBatchUpdateNotifier* notifier, 1255 ScopedBatchUpdateNotifier* notifier,
1256 const base::string16& filter) { 1256 const base::string16& filter) {
1257 CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); 1257 CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot());
1258 1258
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 1335
1336 void CookiesTreeModel::NotifyObserverEndBatch() { 1336 void CookiesTreeModel::NotifyObserverEndBatch() {
1337 // Only notify the observers if this is the outermost call to EndBatch() if 1337 // Only notify the observers if this is the outermost call to EndBatch() if
1338 // called in a nested manner. 1338 // called in a nested manner.
1339 if (--batch_update_ == 0) { 1339 if (--batch_update_ == 0) {
1340 FOR_EACH_OBSERVER(Observer, 1340 FOR_EACH_OBSERVER(Observer,
1341 cookies_observer_list_, 1341 cookies_observer_list_,
1342 TreeModelEndBatch(this)); 1342 TreeModelEndBatch(this));
1343 } 1343 }
1344 } 1344 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698