[Tizen][M34-Merge] Implement favicon database get API
[platform/framework/web/chromium-efl.git] / components / rlz / rlz_tracker_delegate.h
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.
4
5 #ifndef COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_
6 #define COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_
7
8 #include <string>
9
10 #include "base/callback_forward.h"
11 #include "base/macros.h"
12 #include "base/strings/string16.h"
13
14 namespace net {
15 class URLRequestContextGetter;
16 }
17
18 namespace rlz {
19
20 // RLZTrackerDelegate is an abstract interface that provides access to embedder
21 // specific singletons or gives information about the embedder environment.
22 class RLZTrackerDelegate {
23  public:
24   RLZTrackerDelegate() {}
25   virtual ~RLZTrackerDelegate() {}
26
27   // Invoked during RLZTracker cleanup, to request the cleanup of the delegate.
28   virtual void Cleanup() = 0;
29
30   // Returns whether the current thread is the UI thread.
31   virtual bool IsOnUIThread() = 0;
32
33   // Returns the URLRequestContextGetter to use for network connections.
34   virtual net::URLRequestContextGetter* GetRequestContext() = 0;
35
36   // Returns the brand code for the installation of Chrome in |brand| and a
37   // boolean indicating whether the operation was a success or not.
38   virtual bool GetBrand(std::string* brand) = 0;
39
40   // Returns whether |brand| is an organic brand.
41   virtual bool IsBrandOrganic(const std::string& brand) = 0;
42
43   // Returns the reactivation brand code for Chrome in |brand| and a boolean
44   // indicating whether the operation was a success or not.
45   virtual bool GetReactivationBrand(std::string* brand) = 0;
46
47   // Returns true if RLZTracker should ignore initial delay for testing.
48   virtual bool ShouldEnableZeroDelayForTesting() = 0;
49
50   // Returns the installation language in |language| and a boolean indicating
51   // whether the operation was a success or not.
52   virtual bool GetLanguage(base::string16* language) = 0;
53
54   // Returns the referral code in |referral| and a boolean indicating whether
55   // the operation was a success or not. Deprecated.
56   virtual bool GetReferral(base::string16* referral) = 0;
57
58   // Clears the referral code. Deprecated.
59   virtual bool ClearReferral() = 0;
60
61   // Registers |callback| to be invoked the next time the user perform a search
62   // using Google search engine via the omnibox. Callback will invoked at most
63   // once.
64   virtual void SetOmniboxSearchCallback(const base::Closure& callback) = 0;
65
66   // Registers |callback| to be invoked the next time the user perform a search
67   // using Google search engine via the homepage. Callback will invoked at most
68   // once.
69   virtual void SetHomepageSearchCallback(const base::Closure& callback) = 0;
70
71  private:
72   DISALLOW_COPY_AND_ASSIGN(RLZTrackerDelegate);
73 };
74
75 }  // namespace rlz
76
77 #endif  // COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_