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

Side by Side Diff: chrome/browser/rlz/chrome_rlz_tracker_delegate.h

Issue 1212163011: Componentize chrome/browser/rlz (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation with gn 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
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 CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_
6 #define CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_
7
8 #include "build/build_config.h"
9
10 #if defined(ENABLE_RLZ)
11
12 #include "base/callback_list.h"
13 #include "base/macros.h"
14 #include "components/rlz/rlz_tracker_delegate.h"
15 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/notification_registrar.h"
17
18 class Profile;
19
20 // ChromeRLZTrackerDelegate implements RLZTrackerDelegate abstract interface
21 // and provides access to Chrome features.
22 class ChromeRLZTrackerDelegate : public RLZTrackerDelegate,
23 public content::NotificationObserver {
24 public:
25 explicit ChromeRLZTrackerDelegate();
26 ~ChromeRLZTrackerDelegate() override;
27
28 static bool IsGoogleDefaultSearch(Profile* profile);
29 static bool IsGoogleHomepage(Profile* profile);
30 static bool IsGoogleInStartpages(Profile* profile);
31
32 private:
33 // RLZTrackerDelegate implementation.
34 void Cleanup() override;
35 bool IsOnUIThread() override;
36 base::SequencedWorkerPool* GetBlockingPool() override;
37 net::URLRequestContextGetter* GetRequestContext() override;
38 bool GetBrand(std::string* brand) override;
39 bool IsBrandOrganic(const std::string& brand) override;
40 bool GetReactivationBrand(std::string* brand) override;
41 bool ShouldEnableZeroDelayForTesting() override;
42 bool GetLanguage(base::string16* language) override;
43 bool GetReferral(base::string16* referral) override;
44 bool ClearReferral() override;
45 void SetOmniboxSearchCallback(const base::Closure& callback) override;
46 void SetHomepageSearchCallback(const base::Closure& callback) override;
47
48 // content::NotificationObserver implementation:
49 void Observe(int type,
50 const content::NotificationSource& source,
51 const content::NotificationDetails& details) override;
52
53 content::NotificationRegistrar registrar_;
54 base::Closure on_omnibox_search_callback_;
55 base::Closure on_homepage_search_callback_;
56
57 DISALLOW_COPY_AND_ASSIGN(ChromeRLZTrackerDelegate);
58 };
59
60 #endif // defined(ENABLE_RLZ)
61
62 #endif // CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698