diff options
author | droger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-15 14:11:35 +0000 |
---|---|---|
committer | droger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-15 14:11:35 +0000 |
commit | d85f2d9363429ec16491e06170419e02977ea2bb (patch) | |
tree | fd611f6fb1423023418f2b18e77953f145fdfe22 | |
parent | 40af255e31ab46e10eeb354df4f5ff9b27bcb4f3 (diff) | |
download | chromium_src-d85f2d9363429ec16491e06170419e02977ea2bb.zip chromium_src-d85f2d9363429ec16491e06170419e02977ea2bb.tar.gz chromium_src-d85f2d9363429ec16491e06170419e02977ea2bb.tar.bz2 |
Merge 262679 "Change access point for Chrome on iOS"
> Change access point for Chrome on iOS
>
> Use the access point C9* for the Omnibox for Chrome on iOS instead of
> the reserved access point RM*.
>
> Chrome on iOS does not have a notion of homepage, so remove the access
> point corresponding to homepage on iOS (CHROME_HOME_PAGE) and the iOS
> specific enumeration value (CHROME_IOS_HOME_PAGE).
>
> BUG=360686
>
> Review URL: https://codereview.chromium.org/225293007
TBR=sdefresne@chromium.org
Review URL: https://codereview.chromium.org/238293004
git-svn-id: svn://svn.chromium.org/chrome/branches/1916/src@263835 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/rlz/rlz.cc | 24 | ||||
-rw-r--r-- | chrome/browser/ui/browser_commands.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/startup/startup_browser_creator_impl.cc | 4 | ||||
-rw-r--r-- | rlz/lib/lib_values.cc | 4 | ||||
-rw-r--r-- | rlz/lib/rlz_enums.h | 2 |
5 files changed, 28 insertions, 10 deletions
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index 00882db..5df2872 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -80,9 +80,11 @@ void RecordProductEvents(bool first_run, rlz_lib::RecordProductEvent(rlz_lib::CHROME, RLZTracker::CHROME_OMNIBOX, rlz_lib::INSTALL); +#if !defined(OS_IOS) rlz_lib::RecordProductEvent(rlz_lib::CHROME, RLZTracker::CHROME_HOME_PAGE, rlz_lib::INSTALL); +#endif // !defined(OS_IOS) if (!already_ran) { // Do the initial event recording if is the first run or if we have an @@ -100,6 +102,7 @@ void RecordProductEvents(bool first_run, 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, rlz_lib::kMaxRlzLength)) { @@ -112,6 +115,7 @@ void RecordProductEvents(bool first_run, RLZTracker::CHROME_HOME_PAGE, rlz_lib::SET_TO_GOOGLE); } +#endif // !defined(OS_IOS) } // Record first user interaction with the omnibox. We call this all the @@ -122,6 +126,7 @@ void RecordProductEvents(bool first_run, rlz_lib::FIRST_SEARCH); } +#if !defined(OS_IOS) // Record first user interaction with the home page. We call this all the // time but the rlz lib should ingore all but the first one. if (homepage_used || is_google_in_startpages) { @@ -129,13 +134,16 @@ void RecordProductEvents(bool first_run, RLZTracker::CHROME_HOME_PAGE, rlz_lib::FIRST_SEARCH); } +#endif // !defined(OS_IOS) } bool SendFinancialPing(const std::string& brand, const base::string16& lang, const base::string16& referral) { rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX, +#if !defined(OS_IOS) RLZTracker::CHROME_HOME_PAGE, +#endif rlz_lib::NO_ACCESS_POINT}; std::string lang_ascii(base::UTF16ToASCII(lang)); std::string referral_ascii(base::UTF16ToASCII(referral)); @@ -164,9 +172,6 @@ const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = // static const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = rlz_lib::CHROME_IOS_OMNIBOX; -// static -const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = - rlz_lib::CHROME_IOS_HOME_PAGE; #elif defined(OS_MACOSX) // static const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = @@ -257,10 +262,12 @@ bool RLZTracker::InitRlzFromProfileDelayed(Profile* profile, return false; } +#if !defined(OS_IOS) // 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); +#endif // !defined(OS_IOS) return true; } @@ -289,10 +296,12 @@ bool RLZTracker::Init(bool first_run, registrar_.Add(this, chrome::NOTIFICATION_OMNIBOX_OPENED_URL, content::NotificationService::AllSources()); +#if !defined(OS_IOS) // Register for notifications from navigations, to see if the user has used // the home page. registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING, content::NotificationService::AllSources()); +#endif // !defined(OS_IOS) } google_util::GetReactivationBrand(&reactivation_brand_); @@ -373,7 +382,9 @@ void RLZTracker::PingNowImpl() { // Prime the RLZ cache for the access points we are interested in. GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, NULL); +#if !defined(OS_IOS) GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, NULL); +#endif // !defined(OS_IOS) } if (!IsBrandOrganic(reactivation_brand_)) { @@ -397,6 +408,7 @@ void RLZTracker::Observe(int type, registrar_.Remove(this, chrome::NOTIFICATION_OMNIBOX_OPENED_URL, content::NotificationService::AllSources()); break; +#if !defined(OS_IOS) case content::NOTIFICATION_NAV_ENTRY_PENDING: { const NavigationEntry* entry = content::Details<content::NavigationEntry>(details).ptr(); @@ -409,6 +421,7 @@ void RLZTracker::Observe(int type, } break; } +#endif // !defined(OS_IOS) default: NOTREACHED(); break; @@ -463,8 +476,13 @@ void RLZTracker::RecordFirstSearch(rlz_lib::AccessPoint point) { if (ScheduleRecordFirstSearch(point)) return; +#if !defined(OS_IOS) bool* record_used = point == CHROME_OMNIBOX ? &omnibox_used_ : &homepage_used_; +#else + DCHECK_EQ(CHROME_OMNIBOX, point); + bool* record_used = &omnibox_used_; +#endif // Try to record event now, else set the flag to try later when we // attempt the ping. diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 94d132e..bbf4f02 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc @@ -448,7 +448,7 @@ void Home(Browser* browser, WindowOpenDisposition disposition) { content::RecordAction(UserMetricsAction("Home")); std::string extra_headers; -#if defined(ENABLE_RLZ) +#if defined(ENABLE_RLZ) && !defined(OS_IOS) // If the home page is a Google home page, add the RLZ header to the request. PrefService* pref_service = browser->profile()->GetPrefs(); if (pref_service) { @@ -458,7 +458,7 @@ void Home(Browser* browser, WindowOpenDisposition disposition) { RLZTracker::CHROME_HOME_PAGE); } } -#endif +#endif // defined(ENABLE_RLZ) && !defined(OS_IOS) GURL url = browser->profile()->GetHomePage(); diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc index bcf713a..836940a 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc @@ -810,12 +810,12 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser( params.tabstrip_add_types = add_types; params.extension_app_id = tabs[i].app_id; -#if defined(ENABLE_RLZ) +#if defined(ENABLE_RLZ) && !defined(OS_IOS) if (process_startup && google_util::IsGoogleHomePageUrl(tabs[i].url)) { params.extra_headers = RLZTracker::GetAccessPointHttpHeader( RLZTracker::CHROME_HOME_PAGE); } -#endif +#endif // defined(ENABLE_RLZ) && !defined(OS_IOS) chrome::Navigate(¶ms); diff --git a/rlz/lib/lib_values.cc b/rlz/lib/lib_values.cc index 8874a29..12bf457 100644 --- a/rlz/lib/lib_values.cc +++ b/rlz/lib/lib_values.cc @@ -98,8 +98,8 @@ const char* GetAccessPointName(AccessPoint point) { case CHROMEOS_OMNIBOX: return "CA"; case CHROMEOS_HOME_PAGE: return "CB"; case CHROMEOS_RESERVED: return "CC"; - case CHROME_IOS_OMNIBOX: return "RM"; - case CHROME_IOS_HOME_PAGE: return "RN"; + case CHROME_IOS_OMNIBOX: return "C9"; + case CHROME_IOS_RESERVED: return "C0"; case UNDEFINED_AP_O: return "RO"; case UNDEFINED_AP_P: return "RP"; case UNDEFINED_AP_Q: return "RQ"; diff --git a/rlz/lib/rlz_enums.h b/rlz/lib/rlz_enums.h index 08d8bbb..baf176b 100644 --- a/rlz/lib/rlz_enums.h +++ b/rlz/lib/rlz_enums.h @@ -63,7 +63,7 @@ enum AccessPoint { CHROMEOS_RESERVED, // Reserved for ChromeOS. CHROME_IOS_OMNIBOX, // Chrome searches through the address bar omnibox (iOS). - CHROME_IOS_HOME_PAGE,// Chrome searches through Google as home page (iOS). + CHROME_IOS_RESERVED, // Reserved for Chrome on iOS. // Unclaimed access points - should be used first before creating new APs. // Please also make sure you re-name the enum before using an unclaimed value; |