summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browsing_data_appcache_helper.h
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-26 23:45:35 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-26 23:45:35 +0000
commitf26795ebb86f6bcd4da9d4971e252eea933cfdf3 (patch)
treef8ff18dade9b45f6d5924d03d488bcfeb518cf1c /chrome/browser/browsing_data_appcache_helper.h
parentea4929e2226a1a83becb9ea6e4b3fb0c29b11c0e (diff)
downloadchromium_src-f26795ebb86f6bcd4da9d4971e252eea933cfdf3.zip
chromium_src-f26795ebb86f6bcd4da9d4971e252eea933cfdf3.tar.gz
chromium_src-f26795ebb86f6bcd4da9d4971e252eea933cfdf3.tar.bz2
Teach the cookie tree view and model about appcaches. Not hooked up to real data yet, but the view and model pieces are in place for windows and gtk (not yet done for the mac).
Also adds a 'name' attribute to database details pane, cleans up the layout of the detail panes on windows. BUG=25977 TEST=manual Review URL: http://codereview.chromium.org/650110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data_appcache_helper.h')
-rw-r--r--chrome/browser/browsing_data_appcache_helper.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/chrome/browser/browsing_data_appcache_helper.h b/chrome/browser/browsing_data_appcache_helper.h
new file mode 100644
index 0000000..8c28d40
--- /dev/null
+++ b/chrome/browser/browsing_data_appcache_helper.h
@@ -0,0 +1,72 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_
+#define CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_
+
+#include <string>
+#include <vector>
+
+#include "base/scoped_ptr.h"
+#include "base/task.h"
+#include "chrome/common/appcache/chrome_appcache_service.h"
+
+class Profile;
+
+// This class fetches appcache information on behalf of a caller
+// on the UI thread.
+class BrowsingDataAppCacheHelper
+ : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> {
+ public:
+ // Contains detailed information about an appcache.
+ struct AppCacheInfo {
+ AppCacheInfo() {}
+ AppCacheInfo(const GURL& manifest_url,
+ int64 size,
+ base::Time creation_time,
+ base::Time last_access_time,
+ int64 group_id)
+ : manifest_url(manifest_url),
+ size(size),
+ creation_time(creation_time),
+ last_access_time(last_access_time),
+ group_id(group_id) {
+ }
+
+ GURL manifest_url;
+ int64 size;
+ base::Time creation_time;
+ base::Time last_access_time;
+ int64 group_id;
+ };
+
+ explicit BrowsingDataAppCacheHelper(Profile* profile);
+
+ virtual void StartFetching(Callback0::Type* completion_callback);
+ virtual void CancelNotification();
+ virtual void DeleteAppCache(int64 group_id);
+
+ const std::vector<AppCacheInfo>& info_list() const {
+ DCHECK(!is_fetching_);
+ return info_list_;
+ }
+
+ private:
+ friend class base::RefCountedThreadSafe<BrowsingDataAppCacheHelper>;
+ friend class MockBrowsingDataAppCacheHelper;
+
+ virtual ~BrowsingDataAppCacheHelper() {}
+
+ void StartFetchingInIOThread();
+ void OnFetchComplete();
+ void DeleteAppCacheInIOThread(int64 group_id);
+
+ bool is_fetching_;
+ std::vector<AppCacheInfo> info_list_;
+ scoped_ptr<Callback0::Type> completion_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper);
+};
+
+#endif // CHROME_BROWSER_BROWSING_DATA_APPCACHE_HELPER_H_