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

Unified 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: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/rlz/chrome_rlz_tracker_delegate.h
diff --git a/chrome/browser/rlz/chrome_rlz_tracker_delegate.h b/chrome/browser/rlz/chrome_rlz_tracker_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..3494775666c852c3b4d546adc7a2969ec5b00652
--- /dev/null
+++ b/chrome/browser/rlz/chrome_rlz_tracker_delegate.h
@@ -0,0 +1,56 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_
+#define CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_
+
+#include "base/callback_list.h"
+#include "base/macros.h"
+#include "components/rlz/rlz_tracker_delegate.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+
+class Profile;
+
+// ChromeRLZTrackerDelegate implements RLZTrackerDelegate abstract interface
+// and provides access to Chrome features.
+class ChromeRLZTrackerDelegate : public rlz::RLZTrackerDelegate,
+ public content::NotificationObserver {
+ public:
+ ChromeRLZTrackerDelegate();
+ ~ChromeRLZTrackerDelegate() override;
+
+ static bool IsGoogleDefaultSearch(Profile* profile);
+ static bool IsGoogleHomepage(Profile* profile);
+ static bool IsGoogleInStartpages(Profile* profile);
+
+ private:
+ // RLZTrackerDelegate implementation.
+ void Cleanup() override;
+ bool IsOnUIThread() override;
+ base::SequencedWorkerPool* GetBlockingPool() override;
+ net::URLRequestContextGetter* GetRequestContext() override;
+ bool GetBrand(std::string* brand) override;
+ bool IsBrandOrganic(const std::string& brand) override;
+ bool GetReactivationBrand(std::string* brand) override;
+ bool ShouldEnableZeroDelayForTesting() override;
+ bool GetLanguage(base::string16* language) override;
+ bool GetReferral(base::string16* referral) override;
+ bool ClearReferral() override;
+ void SetOmniboxSearchCallback(const base::Closure& callback) override;
+ void SetHomepageSearchCallback(const base::Closure& callback) override;
+
+ // content::NotificationObserver implementation:
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
+
+ content::NotificationRegistrar registrar_;
+ base::Closure on_omnibox_search_callback_;
+ base::Closure on_homepage_search_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeRLZTrackerDelegate);
+};
+
+#endif // CHROME_BROWSER_RLZ_CHROME_RLZ_TRACKER_DELEGATE_H_
« no previous file with comments | « chrome/browser/chromeos/login/session/user_session_manager.cc ('k') | chrome/browser/rlz/chrome_rlz_tracker_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698