summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 15:32:42 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 15:32:42 +0000
commit3cc47d6ba4dd8f5522e0b1939c3906742d964d94 (patch)
tree07b371fb4d1c5079a826e159756d63b0451a034b /chrome/browser/dom_ui
parent6cb60aa4474b7bd3680f5ce36aaf08bf0484dbea (diff)
downloadchromium_src-3cc47d6ba4dd8f5522e0b1939c3906742d964d94.zip
chromium_src-3cc47d6ba4dd8f5522e0b1939c3906742d964d94.tar.gz
chromium_src-3cc47d6ba4dd8f5522e0b1939c3906742d964d94.tar.bz2
Add IndexedDB to cookie tree.
XIB changes: Add another view with IndexedDB details to CookieDetailsView.xib. BUG=56248 TEST=CookiesTreeModelTest.*:CookiesDetailsTest.*:CookiesViewTest.*: Review URL: http://codereview.chromium.org/3429020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/cookies_view_handler.cc34
1 files changed, 32 insertions, 2 deletions
diff --git a/chrome/browser/dom_ui/cookies_view_handler.cc b/chrome/browser/dom_ui/cookies_view_handler.cc
index 4f62393..06c9808 100644
--- a/chrome/browser/dom_ui/cookies_view_handler.cc
+++ b/chrome/browser/dom_ui/cookies_view_handler.cc
@@ -13,6 +13,7 @@
#include "base/values.h"
#include "chrome/browser/browsing_data_appcache_helper.h"
#include "chrome/browser/browsing_data_database_helper.h"
+#include "chrome/browser/browsing_data_indexed_db_helper.h"
#include "chrome/browser/browsing_data_local_storage_helper.h"
#include "chrome/browser/profile.h"
#include "grit/generated_resources.h"
@@ -96,7 +97,7 @@ bool GetCookieTreeNodeDictionary(const CookieTreeNode& node,
const BrowsingDataDatabaseHelper::DatabaseInfo& database_info =
*node.GetDetailedInfo().database_info;
- dict->SetString(kKeyName,database_info.database_name.empty() ?
+ dict->SetString(kKeyName, database_info.database_name.empty() ?
l10n_util::GetStringUTF8(IDS_COOKIES_WEB_DATABASE_UNNAMED_NAME) :
database_info.database_name);
dict->SetString(kKeyDesc, database_info.description);
@@ -146,6 +147,26 @@ bool GetCookieTreeNodeDictionary(const CookieTreeNode& node,
break;
}
+ case CookieTreeNode::DetailedInfo::TYPE_INDEXED_DB: {
+ dict->SetString(kKeyType, "indexed_db");
+ dict->SetString(kKeyIcon, "chrome://theme/IDR_COOKIE_STORAGE_ICON");
+
+ const BrowsingDataIndexedDBHelper::IndexedDBInfo& indexed_db_info =
+ *node.GetDetailedInfo().indexed_db_info;
+
+ dict->SetString(kKeyName, indexed_db_info.database_name.empty() ?
+ l10n_util::GetStringUTF8(IDS_COOKIES_WEB_DATABASE_UNNAMED_NAME) :
+ indexed_db_info.database_name);
+ dict->SetString(kKeyOrigin, indexed_db_info.origin);
+ dict->SetString(kKeySize,
+ FormatBytes(indexed_db_info.size,
+ GetByteDisplayUnits(indexed_db_info.size),
+ true));
+ dict->SetString(kKeyModified, WideToUTF8(
+ base::TimeFormatFriendlyDateAndTime(indexed_db_info.last_modified)));
+
+ break;
+ }
default:
break;
}
@@ -201,6 +222,14 @@ void CookiesViewHandler::GetLocalizedValues(
l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_LAST_MODIFIED_LABEL));
localized_strings->SetString("label_local_storage_origin",
l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL));
+ localized_strings->SetString("label_indexed_db_name",
+ l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_NAME_LABEL));
+ localized_strings->SetString("label_indexed_db_size",
+ l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_SIZE_ON_DISK_LABEL));
+ localized_strings->SetString("label_indexed_db_last_modified",
+ l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_LAST_MODIFIED_LABEL));
+ localized_strings->SetString("label_indexed_db_origin",
+ l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL));
localized_strings->SetString("label_app_cache_manifest",
l10n_util::GetStringUTF16(IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL));
localized_strings->SetString("label_cookie_last_accessed",
@@ -229,7 +258,8 @@ void CookiesViewHandler::Initialize() {
new BrowsingDataDatabaseHelper(profile),
new BrowsingDataLocalStorageHelper(profile),
NULL,
- new BrowsingDataAppCacheHelper(profile)));
+ new BrowsingDataAppCacheHelper(profile),
+ BrowsingDataIndexedDBHelper::Create(profile)));
cookies_tree_model_->AddObserver(this);
}