OLD | NEW |
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/mock_browsing_data_indexed_db_helper.h" | 5 #include "chrome/browser/browsing_data/mock_browsing_data_indexed_db_helper.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "content/public/browser/browser_context.h" |
| 11 #include "content/public/browser/storage_partition.h" |
9 | 12 |
10 MockBrowsingDataIndexedDBHelper::MockBrowsingDataIndexedDBHelper() { | 13 MockBrowsingDataIndexedDBHelper::MockBrowsingDataIndexedDBHelper( |
| 14 Profile* profile) |
| 15 : BrowsingDataIndexedDBHelper( |
| 16 content::BrowserContext::GetDefaultStoragePartition(profile)-> |
| 17 GetIndexedDBContext()) { |
11 } | 18 } |
12 | 19 |
13 MockBrowsingDataIndexedDBHelper::~MockBrowsingDataIndexedDBHelper() { | 20 MockBrowsingDataIndexedDBHelper::~MockBrowsingDataIndexedDBHelper() { |
14 } | 21 } |
15 | 22 |
16 void MockBrowsingDataIndexedDBHelper::StartFetching( | 23 void MockBrowsingDataIndexedDBHelper::StartFetching( |
17 const base::Callback<void(const std::list<content::IndexedDBInfo>&)>& | 24 const base::Callback<void(const std::list<content::IndexedDBInfo>&)>& |
18 callback) { | 25 callback) { |
19 callback_ = callback; | 26 callback_ = callback; |
20 } | 27 } |
(...skipping 26 matching lines...) Expand all Loading... |
47 i->second = true; | 54 i->second = true; |
48 } | 55 } |
49 | 56 |
50 bool MockBrowsingDataIndexedDBHelper::AllDeleted() { | 57 bool MockBrowsingDataIndexedDBHelper::AllDeleted() { |
51 for (std::map<GURL, bool>::const_iterator i = origins_.begin(); | 58 for (std::map<GURL, bool>::const_iterator i = origins_.begin(); |
52 i != origins_.end(); ++i) | 59 i != origins_.end(); ++i) |
53 if (i->second) | 60 if (i->second) |
54 return false; | 61 return false; |
55 return true; | 62 return true; |
56 } | 63 } |
OLD | NEW |