Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / chrome / browser / browsing_data / browsing_data_remover_test_util.h
blobdc7eb17bd6f2ae3c907c2fb6c046c5df72922ba1
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/browsing_data/browsing_data_remover.h"
11 #include "content/public/test/test_utils.h"
13 class BrowsingDataRemoverCompletionObserver
14 : public BrowsingDataRemover::Observer {
15 public:
16 explicit BrowsingDataRemoverCompletionObserver(BrowsingDataRemover* remover);
17 ~BrowsingDataRemoverCompletionObserver() override;
19 void BlockUntilCompletion();
21 protected:
22 // BrowsingDataRemover::Observer:
23 void OnBrowsingDataRemoverDone() override;
25 private:
26 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
28 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionObserver);
31 class BrowsingDataRemoverCompletionInhibitor
32 : public BrowsingDataRemover::CompletionInhibitor {
33 public:
34 BrowsingDataRemoverCompletionInhibitor();
35 ~BrowsingDataRemoverCompletionInhibitor() override;
37 void BlockUntilNearCompletion();
38 void ContinueToCompletion();
40 protected:
41 // BrowsingDataRemover::CompletionInhibitor:
42 void OnBrowsingDataRemoverWouldComplete(
43 BrowsingDataRemover* remover,
44 const base::Closure& continue_to_completion) override;
46 private:
47 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
48 base::Closure continue_to_completion_callback_;
50 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionInhibitor);
53 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_