Update broken references to image assets
[chromium-blink-merge.git] / chrome / browser / browsing_data / browsing_data_helper_browsertest.h
blob8c326c7e4154f5e11382af254f6764bed77db479
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.
5 // Contains code shared by all browsing data browsertests.
7 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_HELPER_BROWSERTEST_H_
8 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_HELPER_BROWSERTEST_H_
10 #include <list>
12 #include "base/basictypes.h"
13 #include "base/logging.h"
14 #include "base/message_loop/message_loop.h"
16 // This template can be used for the StartFetching methods of the browsing data
17 // helper classes. It is supposed to be instantiated with the respective
18 // browsing data info type.
19 template <typename T>
20 class BrowsingDataHelperCallback {
21 public:
22 BrowsingDataHelperCallback() {}
24 const std::list<T>& result() {
25 base::MessageLoop::current()->Run();
26 DCHECK(has_result_);
27 return result_;
30 void callback(const std::list<T>& info) {
31 result_ = info;
32 has_result_ = true;
33 base::MessageLoop::current()->Quit();
36 private:
37 bool has_result_ = false;
38 std::list<T> result_;
40 DISALLOW_COPY_AND_ASSIGN(BrowsingDataHelperCallback);
43 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_HELPER_BROWSERTEST_H_