| Index: chrome/browser/rlz/rlz.cc
|
| diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
|
| index 4f0d1826fdb2c09f379826e6bc23cf96393e36d9..63686b19cc007c78e43f255fa5252ddbee8c6080 100644
|
| --- a/chrome/browser/rlz/rlz.cc
|
| +++ b/chrome/browser/rlz/rlz.cc
|
| @@ -80,14 +80,14 @@ void RecordProductEvents(bool first_run,
|
| // Record the installation of chrome. We call this all the time but the rlz
|
| // lib should ignore all but the first one.
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_OMNIBOX,
|
| + RLZTracker::ChromeOmnibox(),
|
| rlz_lib::INSTALL);
|
| #if !defined(OS_IOS)
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_HOME_PAGE,
|
| + RLZTracker::ChromeHomePage(),
|
| rlz_lib::INSTALL);
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_APP_LIST,
|
| + RLZTracker::ChromeAppList(),
|
| rlz_lib::INSTALL);
|
| #endif // !defined(OS_IOS)
|
|
|
| @@ -95,7 +95,7 @@ void RecordProductEvents(bool first_run,
|
| // Do the initial event recording if is the first run or if we have an
|
| // empty rlz which means we haven't got a chance to do it.
|
| char omnibox_rlz[rlz_lib::kMaxRlzLength + 1];
|
| - if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, omnibox_rlz,
|
| + if (!rlz_lib::GetAccessPointRlz(RLZTracker::ChromeOmnibox(), omnibox_rlz,
|
| rlz_lib::kMaxRlzLength)) {
|
| omnibox_rlz[0] = 0;
|
| }
|
| @@ -103,13 +103,13 @@ void RecordProductEvents(bool first_run,
|
| // Record if google is the initial search provider and/or home page.
|
| if ((first_run || omnibox_rlz[0] == 0) && is_google_default_search) {
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_OMNIBOX,
|
| + RLZTracker::ChromeOmnibox(),
|
| rlz_lib::SET_TO_GOOGLE);
|
| }
|
|
|
| #if !defined(OS_IOS)
|
| char homepage_rlz[rlz_lib::kMaxRlzLength + 1];
|
| - if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, homepage_rlz,
|
| + if (!rlz_lib::GetAccessPointRlz(RLZTracker::ChromeHomePage(), homepage_rlz,
|
| rlz_lib::kMaxRlzLength)) {
|
| homepage_rlz[0] = 0;
|
| }
|
| @@ -117,12 +117,12 @@ void RecordProductEvents(bool first_run,
|
| if ((first_run || homepage_rlz[0] == 0) &&
|
| (is_google_homepage || is_google_in_startpages)) {
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_HOME_PAGE,
|
| + RLZTracker::ChromeHomePage(),
|
| rlz_lib::SET_TO_GOOGLE);
|
| }
|
|
|
| char app_list_rlz[rlz_lib::kMaxRlzLength + 1];
|
| - if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_APP_LIST, app_list_rlz,
|
| + if (!rlz_lib::GetAccessPointRlz(RLZTracker::ChromeAppList(), app_list_rlz,
|
| rlz_lib::kMaxRlzLength)) {
|
| app_list_rlz[0] = 0;
|
| }
|
| @@ -130,7 +130,7 @@ void RecordProductEvents(bool first_run,
|
| // Record if google is the initial search provider and/or home page.
|
| if ((first_run || app_list_rlz[0] == 0) && is_google_default_search) {
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_APP_LIST,
|
| + RLZTracker::ChromeAppList(),
|
| rlz_lib::SET_TO_GOOGLE);
|
| }
|
| #endif // !defined(OS_IOS)
|
| @@ -140,7 +140,7 @@ void RecordProductEvents(bool first_run,
|
| // time but the rlz lib should ingore all but the first one.
|
| if (omnibox_used) {
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_OMNIBOX,
|
| + RLZTracker::ChromeOmnibox(),
|
| rlz_lib::FIRST_SEARCH);
|
| }
|
|
|
| @@ -149,7 +149,7 @@ void RecordProductEvents(bool first_run,
|
| // time but the rlz lib should ingore all but the first one.
|
| if (homepage_used || is_google_in_startpages) {
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_HOME_PAGE,
|
| + RLZTracker::ChromeHomePage(),
|
| rlz_lib::FIRST_SEARCH);
|
| }
|
|
|
| @@ -157,7 +157,7 @@ void RecordProductEvents(bool first_run,
|
| // time but the rlz lib should ingore all but the first one.
|
| if (app_list_used) {
|
| rlz_lib::RecordProductEvent(rlz_lib::CHROME,
|
| - RLZTracker::CHROME_APP_LIST,
|
| + RLZTracker::ChromeAppList(),
|
| rlz_lib::FIRST_SEARCH);
|
| }
|
| #endif // !defined(OS_IOS)
|
| @@ -166,10 +166,10 @@ void RecordProductEvents(bool first_run,
|
| bool SendFinancialPing(const std::string& brand,
|
| const base::string16& lang,
|
| const base::string16& referral) {
|
| - rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX,
|
| + rlz_lib::AccessPoint points[] = {RLZTracker::ChromeOmnibox(),
|
| #if !defined(OS_IOS)
|
| - RLZTracker::CHROME_HOME_PAGE,
|
| - RLZTracker::CHROME_APP_LIST,
|
| + RLZTracker::ChromeHomePage(),
|
| + RLZTracker::ChromeAppList(),
|
| #endif
|
| rlz_lib::NO_ACCESS_POINT};
|
| std::string lang_ascii(base::UTF16ToASCII(lang));
|
| @@ -188,42 +188,6 @@ bool SendFinancialPing(const std::string& brand,
|
|
|
| } // namespace
|
|
|
| -#if defined(OS_WIN)
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX =
|
| - rlz_lib::CHROME_OMNIBOX;
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE =
|
| - rlz_lib::CHROME_HOME_PAGE;
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_APP_LIST =
|
| - rlz_lib::CHROME_APP_LIST;
|
| -#elif defined(OS_IOS)
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX =
|
| - rlz_lib::CHROME_IOS_OMNIBOX;
|
| -#elif defined(OS_MACOSX)
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX =
|
| - rlz_lib::CHROME_MAC_OMNIBOX;
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE =
|
| - rlz_lib::CHROME_MAC_HOME_PAGE;
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_APP_LIST =
|
| - rlz_lib::CHROME_MAC_APP_LIST;
|
| -#elif defined(OS_CHROMEOS)
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX =
|
| - rlz_lib::CHROMEOS_OMNIBOX;
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE =
|
| - rlz_lib::CHROMEOS_HOME_PAGE;
|
| -// static
|
| -const rlz_lib::AccessPoint RLZTracker::CHROME_APP_LIST =
|
| - rlz_lib::CHROMEOS_APP_LIST;
|
| -#endif
|
| -
|
| RLZTracker* RLZTracker::tracker_ = NULL;
|
|
|
| // static
|
| @@ -303,7 +267,7 @@ bool RLZTracker::InitRlzFromProfileDelayed(Profile* profile,
|
| // Prime the RLZ cache for the home page access point so that its avaiable
|
| // for the startup page if needed (i.e., when the startup page is set to
|
| // the home page).
|
| - GetAccessPointRlz(CHROME_HOME_PAGE, NULL);
|
| + GetAccessPointRlz(ChromeHomePage(), NULL);
|
| #endif // !defined(OS_IOS)
|
|
|
| return true;
|
| @@ -420,10 +384,10 @@ void RLZTracker::PingNowImpl() {
|
| }
|
|
|
| // Prime the RLZ cache for the access points we are interested in.
|
| - GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, NULL);
|
| + GetAccessPointRlz(RLZTracker::ChromeOmnibox(), NULL);
|
| #if !defined(OS_IOS)
|
| - GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, NULL);
|
| - GetAccessPointRlz(RLZTracker::CHROME_APP_LIST, NULL);
|
| + GetAccessPointRlz(RLZTracker::ChromeHomePage(), NULL);
|
| + GetAccessPointRlz(RLZTracker::ChromeAppList(), NULL);
|
| #endif // !defined(OS_IOS)
|
| }
|
|
|
| @@ -450,7 +414,7 @@ void RLZTracker::Observe(int type,
|
| // there to keep the old behavior.
|
| if (!content::Details<OmniboxLog>(details).ptr()->is_popup_open)
|
| break;
|
| - RecordFirstSearch(CHROME_OMNIBOX);
|
| + RecordFirstSearch(ChromeOmnibox());
|
| registrar_.Remove(this, chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
|
| content::NotificationService::AllSources());
|
| break;
|
| @@ -461,7 +425,7 @@ void RLZTracker::Observe(int type,
|
| if (entry != NULL &&
|
| ((entry->GetTransitionType() &
|
| content::PAGE_TRANSITION_HOME_PAGE) != 0)) {
|
| - RecordFirstSearch(CHROME_HOME_PAGE);
|
| + RecordFirstSearch(ChromeHomePage());
|
| registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
|
| content::NotificationService::AllSources());
|
| }
|
| @@ -528,7 +492,7 @@ void RLZTracker::RecordFirstSearch(rlz_lib::AccessPoint point) {
|
| // attempt the ping.
|
| if (!RecordProductEvent(rlz_lib::CHROME, point, rlz_lib::FIRST_SEARCH))
|
| *record_used = true;
|
| - else if (send_ping_immediately_ && point == CHROME_OMNIBOX)
|
| + else if (send_ping_immediately_ && point == ChromeOmnibox())
|
| ScheduleDelayedInit(base::TimeDelta());
|
| }
|
|
|
| @@ -545,12 +509,12 @@ bool RLZTracker::ScheduleRecordFirstSearch(rlz_lib::AccessPoint point) {
|
| }
|
|
|
| bool* RLZTracker::GetAccessPointRecord(rlz_lib::AccessPoint point) {
|
| - if (point == CHROME_OMNIBOX)
|
| + if (point == ChromeOmnibox())
|
| return &omnibox_used_;
|
| #if !defined(OS_IOS)
|
| - if (point == CHROME_HOME_PAGE)
|
| + if (point == ChromeHomePage())
|
| return &homepage_used_;
|
| - if (point == CHROME_APP_LIST)
|
| + if (point == ChromeAppList())
|
| return &app_list_used_;
|
| #endif // !defined(OS_IOS)
|
| NOTREACHED();
|
| @@ -668,6 +632,6 @@ void RLZTracker::EnableZeroDelayForTesting() {
|
| #if !defined(OS_IOS)
|
| // static
|
| void RLZTracker::RecordAppListSearch() {
|
| - GetInstance()->RecordFirstSearch(RLZTracker::CHROME_APP_LIST);
|
| + GetInstance()->RecordFirstSearch(RLZTracker::ChromeAppList());
|
| }
|
| #endif
|
|
|