OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_ | 5 #ifndef COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_ |
6 #define COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_ | 6 #define COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "base/threading/sequenced_worker_pool.h" | |
14 | |
15 namespace base { | |
16 class SequencedWorkerPool; | |
17 } | |
18 | 13 |
19 namespace net { | 14 namespace net { |
20 class URLRequestContextGetter; | 15 class URLRequestContextGetter; |
21 } | 16 } |
22 | 17 |
23 namespace rlz { | 18 namespace rlz { |
24 | 19 |
25 // RLZTrackerDelegate is an abstract interface that provides access to embedder | 20 // RLZTrackerDelegate is an abstract interface that provides access to embedder |
26 // specific singletons or gives information about the embedder environment. | 21 // specific singletons or gives information about the embedder environment. |
27 class RLZTrackerDelegate { | 22 class RLZTrackerDelegate { |
28 public: | 23 public: |
29 RLZTrackerDelegate() {} | 24 RLZTrackerDelegate() {} |
30 virtual ~RLZTrackerDelegate() {} | 25 virtual ~RLZTrackerDelegate() {} |
31 | 26 |
32 // Invoked during RLZTracker cleanup, to request the cleanup of the delegate. | 27 // Invoked during RLZTracker cleanup, to request the cleanup of the delegate. |
33 virtual void Cleanup() = 0; | 28 virtual void Cleanup() = 0; |
34 | 29 |
35 // Returns whether the current thread is the UI thread. | 30 // Returns whether the current thread is the UI thread. |
36 virtual bool IsOnUIThread() = 0; | 31 virtual bool IsOnUIThread() = 0; |
37 | 32 |
38 // Returns the SequencedWorkerPool where the RLZTracker will post its tasks | |
39 // that should be executed in the background. | |
40 virtual base::SequencedWorkerPool* GetBlockingPool() = 0; | |
41 | |
42 // Returns the URLRequestContextGetter to use for network connections. | 33 // Returns the URLRequestContextGetter to use for network connections. |
43 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 34 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
44 | 35 |
45 // Returns the brand code for the installation of Chrome in |brand| and a | 36 // Returns the brand code for the installation of Chrome in |brand| and a |
46 // boolean indicating whether the operation was a success or not. | 37 // boolean indicating whether the operation was a success or not. |
47 virtual bool GetBrand(std::string* brand) = 0; | 38 virtual bool GetBrand(std::string* brand) = 0; |
48 | 39 |
49 // Returns whether |brand| is an organic brand. | 40 // Returns whether |brand| is an organic brand. |
50 virtual bool IsBrandOrganic(const std::string& brand) = 0; | 41 virtual bool IsBrandOrganic(const std::string& brand) = 0; |
51 | 42 |
(...skipping 25 matching lines...) Expand all Loading... |
77 // once. | 68 // once. |
78 virtual void SetHomepageSearchCallback(const base::Closure& callback) = 0; | 69 virtual void SetHomepageSearchCallback(const base::Closure& callback) = 0; |
79 | 70 |
80 private: | 71 private: |
81 DISALLOW_COPY_AND_ASSIGN(RLZTrackerDelegate); | 72 DISALLOW_COPY_AND_ASSIGN(RLZTrackerDelegate); |
82 }; | 73 }; |
83 | 74 |
84 } // namespace rlz | 75 } // namespace rlz |
85 | 76 |
86 #endif // COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_ | 77 #endif // COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_ |
OLD | NEW |