Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: components/rlz/rlz_tracker_delegate.h

Issue 1229933005: Revert "Componentize chrome/browser/rlz" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/rlz/rlz_tracker_chromeos.cc ('k') | components/rlz/rlz_tracker_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 #include "base/threading/sequenced_worker_pool.h"
14
15 namespace base {
16 class SequencedWorkerPool;
17 }
18
19 namespace net {
20 class URLRequestContextGetter;
21 }
22
23 namespace rlz {
24
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() {}
31
32 // Invoked during RLZTracker cleanup, to request the cleanup of the delegate.
33 virtual void Cleanup() = 0;
34
35 // Returns whether the current thread is the UI thread.
36 virtual bool IsOnUIThread() = 0;
37
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.
43 virtual net::URLRequestContextGetter* GetRequestContext() = 0;
44
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;
48
49 // Returns whether |brand| is an organic brand.
50 virtual bool IsBrandOrganic(const std::string& brand) = 0;
51
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;
55
56 // Returns true if RLZTracker should ignore initial delay for testing.
57 virtual bool ShouldEnableZeroDelayForTesting() = 0;
58
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;
62
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;
66
67 // Clears the referral code. Deprecated.
68 virtual bool ClearReferral() = 0;
69
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;
74
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;
79
80 private:
81 DISALLOW_COPY_AND_ASSIGN(RLZTrackerDelegate);
82 };
83
84 } // namespace rlz
85
86 #endif // COMPONENTS_RLZ_RLZ_TRACKER_DELEGATE_H_
OLDNEW
« no previous file with comments | « components/rlz/rlz_tracker_chromeos.cc ('k') | components/rlz/rlz_tracker_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698