diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-18 10:02:26 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-18 10:02:26 +0000 |
commit | ec3d1456bdbfd7d7806e51dd1e59088f691495ec (patch) | |
tree | 7f85308cde8eab9ffebcb4910894c184060ba15f /chrome/browser/cookies_tree_model.cc | |
parent | 4236df757e45014700da962b9a20d46f61b4440f (diff) | |
download | chromium_src-ec3d1456bdbfd7d7806e51dd1e59088f691495ec.zip chromium_src-ec3d1456bdbfd7d7806e51dd1e59088f691495ec.tar.gz chromium_src-ec3d1456bdbfd7d7806e51dd1e59088f691495ec.tar.bz2 |
Actually delete databases in CookiesTreeModel.
BUG=34633
TEST=delete a database while it's opened in the renderer
Review URL: http://codereview.chromium.org/600104
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cookies_tree_model.cc')
-rw-r--r-- | chrome/browser/cookies_tree_model.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/chrome/browser/cookies_tree_model.cc b/chrome/browser/cookies_tree_model.cc index b6b56b8..0238c12 100644 --- a/chrome/browser/cookies_tree_model.cc +++ b/chrome/browser/cookies_tree_model.cc @@ -129,7 +129,9 @@ class OriginNodeComparator { CookieTreeDatabaseNode::CookieTreeDatabaseNode( BrowsingDataDatabaseHelper::DatabaseInfo* database_info) - : CookieTreeNode(UTF8ToWide(database_info->database_name)), + : CookieTreeNode(UTF8ToWide(database_info->database_name.empty() ? + database_info->origin_identifier : + database_info->database_name)), database_info_(database_info) { } @@ -143,7 +145,10 @@ void CookieTreeDatabaseNode::DeleteStoredObjects() { CookieTreeLocalStorageNode::CookieTreeLocalStorageNode( BrowsingDataLocalStorageHelper::LocalStorageInfo* local_storage_info) - : CookieTreeNode(UTF8ToWide(local_storage_info->origin)), + : CookieTreeNode(UTF8ToWide( + local_storage_info->origin.empty() ? + local_storage_info->database_identifier : + local_storage_info->origin)), local_storage_info_(local_storage_info) { } @@ -213,9 +218,9 @@ CookieTreeLocalStoragesNode* CookieTreeLocalStoragesNode* retval = new CookieTreeLocalStoragesNode; int index = 0; if (cookies_child_) - index++; + ++index; if (databases_child_) - index++; + ++index; GetModel()->Add(this, index, retval); local_storages_child_ = retval; return retval; @@ -442,7 +447,8 @@ void CookiesTreeModel::PopulateDatabaseInfoWithFilter( for (DatabaseInfoList::iterator database_info = database_info_list_.begin(); database_info != database_info_list_.end(); ++database_info) { - std::string origin = database_info->host; + std::string origin = database_info->host.empty() ? + database_info->origin_identifier : database_info->host; if (!filter.size() || (UTF8ToWide(origin).find(filter) != std::wstring::npos)) { CookieTreeOriginNode* origin_node = root->GetOrCreateOriginNode( @@ -469,7 +475,8 @@ void CookiesTreeModel::PopulateLocalStorageInfoWithFilter( local_storage_info_list_.begin(); local_storage_info != local_storage_info_list_.end(); ++local_storage_info) { - std::string origin = local_storage_info->host; + std::string origin = local_storage_info->host.empty() ? + local_storage_info->database_identifier : local_storage_info->host; if (!filter.size() || (UTF8ToWide(origin).find(filter) != std::wstring::npos)) { CookieTreeOriginNode* origin_node = root->GetOrCreateOriginNode( |