summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsdefresne@chromium.org <sdefresne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-09 13:04:55 +0000
committersdefresne@chromium.org <sdefresne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-09 13:04:55 +0000
commit0c9052ee54f48b9813ddfbd018902e5029a97160 (patch)
tree4f1188ac4f62630b4773d842119d30fefca2443c
parent6b7f960211ac6d31e3b8d450e8233affee1227c2 (diff)
downloadchromium_src-0c9052ee54f48b9813ddfbd018902e5029a97160.zip
chromium_src-0c9052ee54f48b9813ddfbd018902e5029a97160.tar.gz
chromium_src-0c9052ee54f48b9813ddfbd018902e5029a97160.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262679 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/rlz/rlz.cc31
-rw-r--r--chrome/browser/ui/browser_commands.cc4
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_impl.cc4
-rw-r--r--rlz/lib/lib_values.cc4
-rw-r--r--rlz/lib/rlz_enums.h2
5 files changed, 24 insertions, 21 deletions
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index 826f1a5..a355450 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -81,14 +81,14 @@ 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);
-#if !defined(OS_IOS)
rlz_lib::RecordProductEvent(rlz_lib::CHROME,
RLZTracker::CHROME_APP_LIST,
rlz_lib::INSTALL);
-#endif
+#endif // !defined(OS_IOS)
if (!already_ran) {
// Do the initial event recording if is the first run or if we have an
@@ -106,6 +106,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)) {
@@ -119,7 +120,6 @@ void RecordProductEvents(bool first_run,
rlz_lib::SET_TO_GOOGLE);
}
-#if !defined(OS_IOS)
char app_list_rlz[rlz_lib::kMaxRlzLength + 1];
if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_APP_LIST, app_list_rlz,
rlz_lib::kMaxRlzLength)) {
@@ -132,7 +132,7 @@ void RecordProductEvents(bool first_run,
RLZTracker::CHROME_APP_LIST,
rlz_lib::SET_TO_GOOGLE);
}
-#endif
+#endif // !defined(OS_IOS)
}
// Record first user interaction with the omnibox. We call this all the
@@ -143,6 +143,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) {
@@ -151,7 +152,6 @@ void RecordProductEvents(bool first_run,
rlz_lib::FIRST_SEARCH);
}
-#if !defined(OS_IOS)
// Record first user interaction with the app list. We call this all the
// time but the rlz lib should ingore all but the first one.
if (app_list_used) {
@@ -159,15 +159,15 @@ void RecordProductEvents(bool first_run,
RLZTracker::CHROME_APP_LIST,
rlz_lib::FIRST_SEARCH);
}
-#endif
+#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,
- RLZTracker::CHROME_HOME_PAGE,
#if !defined(OS_IOS)
+ RLZTracker::CHROME_HOME_PAGE,
RLZTracker::CHROME_APP_LIST,
#endif
rlz_lib::NO_ACCESS_POINT};
@@ -201,9 +201,6 @@ const rlz_lib::AccessPoint RLZTracker::CHROME_APP_LIST =
// 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 =
@@ -301,10 +298,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;
}
@@ -333,10 +332,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_);
@@ -419,10 +420,10 @@ void RLZTracker::PingNowImpl() {
// Prime the RLZ cache for the access points we are interested in.
GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, NULL);
- GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, NULL);
#if !defined(OS_IOS)
+ GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, NULL);
GetAccessPointRlz(RLZTracker::CHROME_APP_LIST, NULL);
-#endif
+#endif // !defined(OS_IOS)
}
if (!IsBrandOrganic(reactivation_brand_)) {
@@ -446,6 +447,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();
@@ -458,6 +460,7 @@ void RLZTracker::Observe(int type,
}
break;
}
+#endif // !defined(OS_IOS)
default:
NOTREACHED();
break;
@@ -537,12 +540,12 @@ bool RLZTracker::ScheduleRecordFirstSearch(rlz_lib::AccessPoint point) {
bool* RLZTracker::GetAccessPointRecord(rlz_lib::AccessPoint point) {
if (point == CHROME_OMNIBOX)
return &omnibox_used_;
+#if !defined(OS_IOS)
if (point == CHROME_HOME_PAGE)
return &homepage_used_;
-#if !defined(OS_IOS)
if (point == CHROME_APP_LIST)
return &app_list_used_;
-#endif
+#endif // !defined(OS_IOS)
NOTREACHED();
return NULL;
}
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 14bdc16..7ee8fb8 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 ce9ad97..b436bb6 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -816,12 +816,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(&params);
diff --git a/rlz/lib/lib_values.cc b/rlz/lib/lib_values.cc
index 8047a9a..06113a8 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_APP_LIST: 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 CHROME_APP_LIST: return "C7";
case CHROME_MAC_APP_LIST: return "C8";
case UNDEFINED_AP_Q: return "RQ";
diff --git a/rlz/lib/rlz_enums.h b/rlz/lib/rlz_enums.h
index 3bfcf64..e50ac2f 100644
--- a/rlz/lib/rlz_enums.h
+++ b/rlz/lib/rlz_enums.h
@@ -63,7 +63,7 @@ enum AccessPoint {
CHROMEOS_APP_LIST, // ChromeOS searches through the app launcher search box.
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.
CHROME_APP_LIST, // Chrome searches through the app launcher search box.
CHROME_MAC_APP_LIST, // Chrome searches through the app launcher search box