Vectorize website settings icons in omnibox
[chromium-blink-merge.git] / components / rlz / rlz_tracker_delegate.h
blobd1270e4d7957f476810f2ade9a844373846d3044
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_
6 #define COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_
8 #include <string>
10 #include "base/callback_forward.h"
11 #include "base/macros.h"
12 #include "base/strings/string16.h"
13 #include "base/threading/sequenced_worker_pool.h"
15 namespace base {
16 class SequencedWorkerPool;
19 namespace net {
20 class URLRequestContextGetter;
23 namespace rlz {
25 // RLZTrackerDelegate is an abstract interface that provides access to embedder
26 // specific singletons or gives information about the embedder environment.
27 class RLZTrackerDelegate {
28 public:
29 RLZTrackerDelegate() {}
30 virtual ~RLZTrackerDelegate() {}
32 // Invoked during RLZTracker cleanup, to request the cleanup of the delegate.
33 virtual void Cleanup() = 0;
35 // Returns whether the current thread is the UI thread.
36 virtual bool IsOnUIThread() = 0;
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;
42 // Returns the URLRequestContextGetter to use for network connections.
43 virtual net::URLRequestContextGetter* GetRequestContext() = 0;
45 // Returns the brand code for the installation of Chrome in |brand| and a
46 // boolean indicating whether the operation was a success or not.
47 virtual bool GetBrand(std::string* brand) = 0;
49 // Returns whether |brand| is an organic brand.
50 virtual bool IsBrandOrganic(const std::string& brand) = 0;
52 // Returns the reactivation brand code for Chrome in |brand| and a boolean
53 // indicating whether the operation was a success or not.
54 virtual bool GetReactivationBrand(std::string* brand) = 0;
56 // Returns true if RLZTracker should ignore initial delay for testing.
57 virtual bool ShouldEnableZeroDelayForTesting() = 0;
59 // Returns the installation language in |language| and a boolean indicating
60 // whether the operation was a success or not.
61 virtual bool GetLanguage(base::string16* language) = 0;
63 // Returns the referral code in |referral| and a boolean indicating whether
64 // the operation was a success or not. Deprecated.
65 virtual bool GetReferral(base::string16* referral) = 0;
67 // Clears the referral code. Deprecated.
68 virtual bool ClearReferral() = 0;
70 // Registers |callback| to be invoked the next time the user perform a search
71 // using Google search engine via the omnibox. Callback will invoked at most
72 // once.
73 virtual void SetOmniboxSearchCallback(const base::Closure& callback) = 0;
75 // Registers |callback| to be invoked the next time the user perform a search
76 // using Google search engine via the homepage. Callback will invoked at most
77 // once.
78 virtual void SetHomepageSearchCallback(const base::Closure& callback) = 0;
80 private:
81 DISALLOW_COPY_AND_ASSIGN(RLZTrackerDelegate);
84 } // namespace rlz
86 #endif // COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_