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 CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_
6 #define CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "components/rlz/rlz_tracker_delegate.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
16 // ChromeRLZTrackerDelegate implements RLZTrackerDelegate abstract interface
17 // and provides access to Chrome features.
18 class ChromeRLZTrackerDelegate
: public rlz::RLZTrackerDelegate
,
19 public content::NotificationObserver
{
21 ChromeRLZTrackerDelegate();
22 ~ChromeRLZTrackerDelegate() override
;
24 static bool IsGoogleDefaultSearch(Profile
* profile
);
25 static bool IsGoogleHomepage(Profile
* profile
);
26 static bool IsGoogleInStartpages(Profile
* profile
);
29 // RLZTrackerDelegate implementation.
30 void Cleanup() override
;
31 bool IsOnUIThread() override
;
32 base::SequencedWorkerPool
* GetBlockingPool() override
;
33 net::URLRequestContextGetter
* GetRequestContext() override
;
34 bool GetBrand(std::string
* brand
) override
;
35 bool IsBrandOrganic(const std::string
& brand
) override
;
36 bool GetReactivationBrand(std::string
* brand
) override
;
37 bool ShouldEnableZeroDelayForTesting() override
;
38 bool GetLanguage(base::string16
* language
) override
;
39 bool GetReferral(base::string16
* referral
) override
;
40 bool ClearReferral() override
;
41 void SetOmniboxSearchCallback(const base::Closure
& callback
) override
;
42 void SetHomepageSearchCallback(const base::Closure
& callback
) override
;
44 // content::NotificationObserver implementation:
45 void Observe(int type
,
46 const content::NotificationSource
& source
,
47 const content::NotificationDetails
& details
) override
;
49 content::NotificationRegistrar registrar_
;
50 base::Closure on_omnibox_search_callback_
;
51 base::Closure on_homepage_search_callback_
;
53 DISALLOW_COPY_AND_ASSIGN(ChromeRLZTrackerDelegate
);
56 #endif // CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_