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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_test_util.h

Issue 2613833004: Split BrowsingDataRemover into an abstract interface and implementation. (Closed)
Patch Set: Removed unnecessary instantiations. Created 3 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_ 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_ 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/scoped_observer.h" 10 #include "base/scoped_observer.h"
11 #include "chrome/browser/browsing_data/browsing_data_remover.h" 11 #include "chrome/browser/browsing_data/browsing_data_remover.h"
12 #include "chrome/browser/browsing_data/browsing_data_remover_impl.h"
12 #include "content/public/test/test_utils.h" 13 #include "content/public/test/test_utils.h"
13 14
14 // This class can be used to wait for a BrowsingDataRemover to complete 15 // This class can be used to wait for a BrowsingDataRemover to complete
15 // operation. It is not suitable for repeated use. 16 // operation. It is not suitable for repeated use.
16 class BrowsingDataRemoverCompletionObserver 17 class BrowsingDataRemoverCompletionObserver
17 : public BrowsingDataRemover::Observer { 18 : public BrowsingDataRemover::Observer {
18 public: 19 public:
19 explicit BrowsingDataRemoverCompletionObserver(BrowsingDataRemover* remover); 20 explicit BrowsingDataRemoverCompletionObserver(BrowsingDataRemover* remover);
20 ~BrowsingDataRemoverCompletionObserver() override; 21 ~BrowsingDataRemoverCompletionObserver() override;
21 22
22 void BlockUntilCompletion(); 23 void BlockUntilCompletion();
23 24
24 protected: 25 protected:
25 // BrowsingDataRemover::Observer: 26 // BrowsingDataRemover::Observer:
26 void OnBrowsingDataRemoverDone() override; 27 void OnBrowsingDataRemoverDone() override;
27 28
28 private: 29 private:
29 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; 30 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
30 ScopedObserver<BrowsingDataRemover, BrowsingDataRemover::Observer> observer_; 31 ScopedObserver<BrowsingDataRemover, BrowsingDataRemover::Observer> observer_;
31 32
32 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionObserver); 33 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionObserver);
33 }; 34 };
34 35
35 class BrowsingDataRemoverCompletionInhibitor 36 class BrowsingDataRemoverCompletionInhibitor
36 : public BrowsingDataRemover::CompletionInhibitor { 37 : public BrowsingDataRemoverImpl::CompletionInhibitor {
37 public: 38 public:
38 BrowsingDataRemoverCompletionInhibitor(); 39 BrowsingDataRemoverCompletionInhibitor();
39 ~BrowsingDataRemoverCompletionInhibitor() override; 40 ~BrowsingDataRemoverCompletionInhibitor() override;
40 41
41 void BlockUntilNearCompletion(); 42 void BlockUntilNearCompletion();
42 void ContinueToCompletion(); 43 void ContinueToCompletion();
43 44
44 protected: 45 protected:
45 // BrowsingDataRemover::CompletionInhibitor: 46 // BrowsingDataRemoverImpl::CompletionInhibitor:
46 void OnBrowsingDataRemoverWouldComplete( 47 void OnBrowsingDataRemoverWouldComplete(
47 BrowsingDataRemover* remover, 48 BrowsingDataRemoverImpl* remover,
48 const base::Closure& continue_to_completion) override; 49 const base::Closure& continue_to_completion) override;
49 50
50 private: 51 private:
51 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; 52 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
52 base::Closure continue_to_completion_callback_; 53 base::Closure continue_to_completion_callback_;
53 54
54 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionInhibitor); 55 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionInhibitor);
55 }; 56 };
56 57
57 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_ 58 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698