OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/public/browser/indexed_db_context.h" | 12 #include "content/public/browser/indexed_db_context.h" |
13 #include "content/public/browser/web_ui_controller.h" | 13 #include "content/public/browser/web_ui_controller.h" |
| 14 #include "net/base/net_errors.h" |
14 | 15 |
15 namespace base { class ListValue; } | 16 namespace base { class ListValue; } |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 class StoragePartition; | 20 class StoragePartition; |
| 21 class DownloadItem; |
20 | 22 |
21 // The implementation for the chrome://indexeddb-internals page. | 23 // The implementation for the chrome://indexeddb-internals page. |
22 class IndexedDBInternalsUI : public WebUIController { | 24 class IndexedDBInternalsUI : public WebUIController { |
23 public: | 25 public: |
24 explicit IndexedDBInternalsUI(WebUI* web_ui); | 26 explicit IndexedDBInternalsUI(WebUI* web_ui); |
25 virtual ~IndexedDBInternalsUI(); | 27 virtual ~IndexedDBInternalsUI(); |
26 | 28 |
27 private: | 29 private: |
28 typedef std::vector<scoped_refptr<IndexedDBContext> > ContextList; | 30 typedef std::vector<scoped_refptr<IndexedDBContext> > ContextList; |
29 void GetAllOrigins(const base::ListValue* args); | 31 void GetAllOrigins(const base::ListValue* args); |
30 void GetAllOriginsOnWebkitThread( | 32 void GetAllOriginsOnWebkitThread( |
31 scoped_ptr<ContextList> contexts, | 33 scoped_ptr<ContextList> contexts, |
32 scoped_ptr<std::vector<base::FilePath> > context_paths); | 34 scoped_ptr<std::vector<base::FilePath> > context_paths); |
33 void OnOriginsReady(scoped_ptr<std::vector<IndexedDBInfo> > origins, | 35 void OnOriginsReady(scoped_ptr<std::vector<IndexedDBInfo> > origins, |
34 const base::FilePath& path); | 36 const base::FilePath& path); |
35 | 37 |
36 static void AddContextFromStoragePartition(ContextList* contexts, | 38 static void AddContextFromStoragePartition(ContextList* contexts, |
37 std::vector<base::FilePath>* paths, | 39 std::vector<base::FilePath>* paths, |
38 StoragePartition* partition); | 40 StoragePartition* partition); |
39 | 41 |
| 42 void DownloadOriginData(const base::ListValue* args); |
| 43 void DownloadOriginDataOnWebkitThread(const base::FilePath& partition_path, |
| 44 scoped_refptr<IndexedDBContext> context, |
| 45 const GURL& origin_url); |
| 46 void OnDownloadDataReady(const base::FilePath& partition_path, |
| 47 const GURL& origin_url, |
| 48 const base::FilePath temp_path, |
| 49 const base::FilePath zip_path); |
| 50 void OnDownloadStarted(const base::FilePath& partition_path, |
| 51 const GURL& origin_url, |
| 52 const base::FilePath& temp_path, |
| 53 content::DownloadItem* item, |
| 54 net::Error error); |
| 55 |
40 DISALLOW_COPY_AND_ASSIGN(IndexedDBInternalsUI); | 56 DISALLOW_COPY_AND_ASSIGN(IndexedDBInternalsUI); |
41 }; | 57 }; |
42 | 58 |
43 } // namespace content | 59 } // namespace content |
44 | 60 |
45 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ | 61 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ |
OLD | NEW |