Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: chrome/browser/mock_browsing_data_database_helper.h

Issue 10805015: Move browsing_data_helper files into a separate directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chrome_frame build Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_MOCK_BROWSING_DATA_DATABASE_HELPER_H_
6 #define CHROME_BROWSER_MOCK_BROWSING_DATA_DATABASE_HELPER_H_
7
8 #include <list>
9 #include <map>
10
11 #include "base/callback.h"
12 #include "chrome/browser/browsing_data_database_helper.h"
13
14 // Mock for BrowsingDataDatabaseHelper.
15 // Use AddDatabaseSamples() or add directly to response_ list, then call
16 // Notify().
17 class MockBrowsingDataDatabaseHelper : public BrowsingDataDatabaseHelper {
18 public:
19 explicit MockBrowsingDataDatabaseHelper(Profile* profile);
20
21 virtual void StartFetching(
22 const base::Callback<void(const std::list<DatabaseInfo>&)>& callback)
23 OVERRIDE;
24
25 virtual void DeleteDatabase(const std::string& origin,
26 const std::string& name) OVERRIDE;
27
28 // Adds some DatabaseInfo samples.
29 void AddDatabaseSamples();
30
31 // Notifies the callback.
32 void Notify();
33
34 // Marks all databases as existing.
35 void Reset();
36
37 // Returns true if all databases since the last Reset() invokation were
38 // deleted.
39 bool AllDeleted();
40
41 std::string last_deleted_origin_;
42
43 std::string last_deleted_db_;
44
45 private:
46 virtual ~MockBrowsingDataDatabaseHelper();
47
48 base::Callback<void(const std::list<DatabaseInfo>&)> callback_;
49
50 // Stores which databases exist.
51 std::map<const std::string, bool> databases_;
52
53 std::list<DatabaseInfo> response_;
54 };
55
56 #endif // CHROME_BROWSER_MOCK_BROWSING_DATA_DATABASE_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/mock_browsing_data_cookie_helper.cc ('k') | chrome/browser/mock_browsing_data_database_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698