Print Preview: Changing displayed error message when PDF Viewer is missing.
[chromium-blink-merge.git] / chrome / browser / mock_browsing_data_indexed_db_helper.h
blob3a6a2823bde3181b138cb45ebf0adf22bdacecbf
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MOCK_BROWSING_DATA_INDEXED_DB_HELPER_H_
6 #define CHROME_BROWSER_MOCK_BROWSING_DATA_INDEXED_DB_HELPER_H_
7 #pragma once
9 #include <map>
10 #include <vector>
12 #include "base/callback.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/browsing_data_indexed_db_helper.h"
16 // Mock for BrowsingDataIndexedDBHelper.
17 // Use AddIndexedDBSamples() or add directly to response_ vector, then
18 // call Notify().
19 class MockBrowsingDataIndexedDBHelper
20 : public BrowsingDataIndexedDBHelper {
21 public:
22 explicit MockBrowsingDataIndexedDBHelper(Profile* profile);
24 // Adds some IndexedDBInfo samples.
25 void AddIndexedDBSamples();
27 // Notifies the callback.
28 void Notify();
30 // Marks all indexed db files as existing.
31 void Reset();
33 // Returns true if all indexed db files were deleted since the last
34 // Reset() invokation.
35 bool AllDeleted();
37 // BrowsingDataIndexedDBHelper.
38 virtual void StartFetching(
39 Callback1<const std::vector<IndexedDBInfo>& >::Type* callback);
40 virtual void CancelNotification();
41 virtual void DeleteIndexedDBFile(const FilePath& file_path);
43 FilePath last_deleted_file_;
45 private:
46 virtual ~MockBrowsingDataIndexedDBHelper();
48 Profile* profile_;
50 scoped_ptr<Callback1<const std::vector<IndexedDBInfo>& >::Type >
51 callback_;
53 std::map<const FilePath::StringType, bool> files_;
55 std::vector<IndexedDBInfo> response_;
58 #endif // CHROME_BROWSER_MOCK_BROWSING_DATA_INDEXED_DB_HELPER_H_