Commit bddb028a authored by newt's avatar newt Committed by Commit bot

Remove unused NTP UMA stats.

This deletes four user actions that were added long ago and are no
longer used:
 - MobileFirstEditInOmnibox
 - MobileFocusedFakeboxOnNtp
 - MobileFocusedOmniboxOnNtp
 - MobileFocusedOmniboxNotOnNtp

This also starts recording the FocusLocation user action when the omnibox is
focused; this essentially combines MobileFocusedFakeboxOnNtp,
MobileFocusedOmniboxOnNtp, and MobileFocusedOmniboxNotOnNtp into a single
action.

BUG=408176

Review URL: https://codereview.chromium.org/1491393002

Cr-Commit-Position: refs/heads/master@{#363041}
parent 98f90bfc
...@@ -205,7 +205,6 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener, ...@@ -205,7 +205,6 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
private boolean mSuggestionsShown; private boolean mSuggestionsShown;
private boolean mUrlHasFocus; private boolean mUrlHasFocus;
private boolean mUrlFocusedFromFakebox; private boolean mUrlFocusedFromFakebox;
private boolean mHasRecordedUrlFocusSource;
// Set to true when the user has started typing new input in the omnibox, set to false // Set to true when the user has started typing new input in the omnibox, set to false
// when the omnibox loses focus or becomes empty. // when the omnibox loses focus or becomes empty.
...@@ -276,7 +275,6 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener, ...@@ -276,7 +275,6 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
if (mIgnoreURLBarModification) return; if (mIgnoreURLBarModification) return;
if (!mHasStartedNewOmniboxEditSession && mNativeInitialized) { if (!mHasStartedNewOmniboxEditSession && mNativeInitialized) {
RecordUserAction.record("MobileFirstEditInOmnibox");
mAutocomplete.resetSession(); mAutocomplete.resetSession();
mHasStartedNewOmniboxEditSession = true; mHasStartedNewOmniboxEditSession = true;
mNewOmniboxEditSessionTimestamp = SystemClock.elapsedRealtime(); mNewOmniboxEditSessionTimestamp = SystemClock.elapsedRealtime();
...@@ -951,12 +949,13 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener, ...@@ -951,12 +949,13 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
public void onUrlFocusChange(boolean hasFocus) { public void onUrlFocusChange(boolean hasFocus) {
mUrlHasFocus = hasFocus; mUrlHasFocus = hasFocus;
mUrlContainer.onUrlFocusChanged(hasFocus); mUrlContainer.onUrlFocusChanged(hasFocus);
updateFocusSource(hasFocus);
updateDeleteButtonVisibility(); updateDeleteButtonVisibility();
Tab currentTab = getCurrentTab(); Tab currentTab = getCurrentTab();
if (hasFocus) { if (hasFocus) {
RecordUserAction.record("FocusLocation");
mUrlBar.deEmphasizeUrl(); mUrlBar.deEmphasizeUrl();
} else { } else {
mUrlFocusedFromFakebox = false;
hideSuggestions(); hideSuggestions();
// Focus change caused by a close-tab may result in an invalid current tab. // Focus change caused by a close-tab may result in an invalid current tab.
...@@ -2376,37 +2375,6 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener, ...@@ -2376,37 +2375,6 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener,
loadUrl(url, PageTransition.TYPED); loadUrl(url, PageTransition.TYPED);
} }
/**
* Tracks how the URL bar was focused (i.e. from the omnibox or the fakebox) and records a UMA
* stat for this. Should be called whenever the URL bar gains or loses focus.
* @param hasFocus Whether the URL bar now has focus.
*/
private void updateFocusSource(boolean hasFocus) {
if (!hasFocus) {
mUrlFocusedFromFakebox = false;
mHasRecordedUrlFocusSource = false;
return;
}
// Record UMA event for how the URL bar was focused.
if (mHasRecordedUrlFocusSource) return;
Tab currentTab = getCurrentTab();
if (currentTab == null) return;
String url = currentTab.getUrl();
if (mUrlFocusedFromFakebox) {
RecordUserAction.record("MobileFocusedFakeboxOnNtp");
} else {
if (currentTab.isNativePage() && NewTabPage.isNTPUrl(url)) {
RecordUserAction.record("MobileFocusedOmniboxOnNtp");
} else {
RecordUserAction.record("MobileFocusedOmniboxNotOnNtp");
}
}
mHasRecordedUrlFocusSource = true;
}
@Override @Override
public void onTabLoadingNTP(NewTabPage ntp) { public void onTabLoadingNTP(NewTabPage ntp) {
ntp.setFakeboxDelegate(this); ntp.setFakeboxDelegate(this);
......
...@@ -7936,21 +7936,25 @@ should be able to be added at any place in this file. ...@@ -7936,21 +7936,25 @@ should be able to be added at any place in this file.
<action name="MobileFirstEditInOmnibox"> <action name="MobileFirstEditInOmnibox">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description> <description>Please enter the description of this user action.</description>
<obsolete>Deprecated as of 12/2015</obsolete>
</action> </action>
<action name="MobileFocusedFakeboxOnNtp"> <action name="MobileFocusedFakeboxOnNtp">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description> <description>Please enter the description of this user action.</description>
<obsolete>Deprecated as of 12/2015</obsolete>
</action> </action>
<action name="MobileFocusedOmniboxNotOnNtp"> <action name="MobileFocusedOmniboxNotOnNtp">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description> <description>Please enter the description of this user action.</description>
<obsolete>Deprecated as of 12/2015</obsolete>
</action> </action>
<action name="MobileFocusedOmniboxOnNtp"> <action name="MobileFocusedOmniboxOnNtp">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description> <description>Please enter the description of this user action.</description>
<obsolete>Deprecated as of 12/2015</obsolete>
</action> </action>
<action name="MobileFre.SignInShown"> <action name="MobileFre.SignInShown">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment