Skip to content

Commit

Permalink
Added missing user actions to extension settings and profile settings.
Browse files Browse the repository at this point in the history
R=jwd

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

Cr-Commit-Position: refs/heads/master@{#326108}
  • Loading branch information
andyzg authored and Commit bot committed Apr 21, 2015
1 parent 34f3dad commit 6b19b3f
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 3 deletions.
17 changes: 17 additions & 0 deletions chrome/browser/resources/extensions/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ cr.define('extensions', function() {
extensionList.updateFocusableElements();
chrome.developerPrivate.updateProfileConfiguration(
{inDeveloperMode: e.target.checked});
var suffix = $('toggle-dev-on').checked ? 'Enabled' : 'Disabled';
chrome.send('metricsHandler:recordAction',
['Options_ToggleDeveloperMode_' + suffix]);
}.bind(this));

window.addEventListener('resize', function() {
Expand All @@ -158,6 +161,8 @@ cr.define('extensions', function() {

// Set up the three dev mode buttons (load unpacked, pack and update).
$('load-unpacked').addEventListener('click', function(e) {
chrome.send('metricsHandler:recordAction',
['Options_LoadUnpackedExtension']);
extensionLoader.loadUnpacked();
});
$('pack-extension').addEventListener('click',
Expand Down Expand Up @@ -187,6 +192,16 @@ cr.define('extensions', function() {
extensions.ExtensionOptionsOverlay.getInstance().initializePage(
extensions.ExtensionSettings.showOverlay);

// Add user action logging for bottom links.
var moreExtensionLink =
document.getElementsByClassName('more-extensions-link');
for (var i = 0; i < moreExtensionLink.length; i++) {
moreExtensionLink[i].addEventListener('click', function(e) {
chrome.send('metricsHandler:recordAction',
['Options_GetMoreExtensions']);
});
}

// Initialize the kiosk overlay.
if (cr.isChromeOS) {
var kioskOverlay = extensions.KioskAppsOverlay.getInstance();
Expand Down Expand Up @@ -304,6 +319,8 @@ cr.define('extensions', function() {
*/
handleUpdateExtensionNow_: function(e) {
chrome.developerPrivate.autoUpdate();
chrome.send('metricsHandler:recordAction',
['Options_UpdateExtensions']);
},

/**
Expand Down
8 changes: 6 additions & 2 deletions chrome/browser/resources/options/browser_options.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,17 @@ <h3 i18n-content="sectionTitleUsers"></h3>
<if expr="not chromeos">
<div id="profiles-enable-guest" class="checkbox">
<label>
<input pref="profile.browser_guest_enabled" type="checkbox">
<input pref="profile.browser_guest_enabled"
type="checkbox"
metric="Options_BrowserGuestEnabled">
<span i18n-content="profileBrowserGuestEnable"></span>
</label>
</div>
<div id="profiles-enable-add-person" class="checkbox">
<label>
<input pref="profile.add_person_enabled" type="checkbox">
<input pref="profile.add_person_enabled"
type="checkbox"
metric="Options_AddPersonEnabled">
<span i18n-content="profileAddPersonEnable"></span>
</label>
</div>
Expand Down
9 changes: 8 additions & 1 deletion chrome/browser/resources/options/browser_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ cr.define('options', function() {
profilesList.addEventListener('change',
this.setProfileViewButtonsStatus_);
$('profiles-create').onclick = function(event) {
chrome.send('metricsHandler:recordAction',
['Options_ShowCreateProfileDlg']);
ManageProfileOverlay.showCreateDialog();
};
if (OptionsPage.isSettingsApp()) {
Expand All @@ -352,12 +354,17 @@ cr.define('options', function() {
};
}
$('profiles-manage').onclick = function(event) {
chrome.send('metricsHandler:recordAction',
['Options_ShowEditProfileDlg']);
ManageProfileOverlay.showManageDialog();
};
$('profiles-delete').onclick = function(event) {
var selectedProfile = self.getSelectedProfileItem_();
if (selectedProfile)
if (selectedProfile) {
chrome.send('metricsHandler:recordAction',
['Options_ShowDeleteProfileDlg']);
ManageProfileOverlay.showDeleteDialog(selectedProfile);
}
};
if (loadTimeData.getBoolean('profileIsSupervised')) {
$('profiles-create').disabled = true;
Expand Down
53 changes: 53 additions & 0 deletions tools/metrics/actions/actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8469,6 +8469,20 @@ should be able to be added at any place in this file.
<description>Settings: Accessibility: Enable tap dragging</description>
</action>

<action name="Options_AddPersonEnabled_Disable">
<owner>jwd@chromium.org</owner>
<description>
Settings: People: Disables allowing anyone to add a person to Chrome.
</description>
</action>

<action name="Options_AddPersonEnabled_Enable">
<owner>jwd@chromium.org</owner>
<description>
Settings: People: Enables anyone to add a person to Chrome.
</description>
</action>

<action name="Options_AllowAllUsers_Disable">
<owner>stevenjb@chromium.org</owner>
<description>
Expand Down Expand Up @@ -8601,6 +8615,16 @@ should be able to be added at any place in this file.
<description>Settings: Bluetooth: Add a device</description>
</action>

<action name="Options_BrowserGuestEnabled_Disable">
<owner>jwd@chromium.org</owner>
<description>Settings: People: Disable Guest browsing.</description>
</action>

<action name="Options_BrowserGuestEnabled_Enable">
<owner>jwd@chromium.org</owner>
<description>Settings: People: Allows guests to browse.</description>
</action>

<action name="Options_CaptivePortalBypassProxy_Disable">
<owner>alemate@chromium.org</owner>
<description>
Expand Down Expand Up @@ -8881,6 +8905,11 @@ should be able to be added at any place in this file.
<description>Please enter the description of this user action.</description>
</action>

<action name="Options_GetMoreExtensions">
<owner>jwd@chromium.org</owner>
<description>Extensions: Click on 'Get More Extensions' link.</description>
</action>

<action name="Options_GoogleGeolocationAccessCheckbox_Disable">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description>
Expand Down Expand Up @@ -9128,6 +9157,11 @@ should be able to be added at any place in this file.
<description>Please enter the description of this user action.</description>
</action>

<action name="Options_LoadUnpackedExtension">
<owner>jwd@chromium.org</owner>
<description>Extensions: Loads an unpacked extension.</description>
</action>

<action name="Options_ManageAccounts">
<owner>stevenjb@chromium.org</owner>
<description>Settings: Users: Manage other users</description>
Expand Down Expand Up @@ -9710,6 +9744,20 @@ should be able to be added at any place in this file.
<description>Settings: Date and time: Timezone</description>
</action>

<action name="Options_ToggleDeveloperMode_Disabled">
<owner>jwd@chromium.org</owner>
<description>
Extensions: Disables developer mode for Chrome extensions.
</description>
</action>

<action name="Options_ToggleDeveloperMode_Enabled">
<owner>jwd@chromium.org</owner>
<description>
Extensions: Enables developer mode for Chrome extensions.
</description>
</action>

<action name="Options_TouchpadNaturalScroll_Disable">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description>
Expand Down Expand Up @@ -9740,6 +9788,11 @@ should be able to be added at any place in this file.
<description>Please enter the description of this user action.</description>
</action>

<action name="Options_UpdateExtensions">
<owner>jwd@chromium.org</owner>
<description>Extensions: Click on update extensions in settings.</description>
</action>

<action name="Options_Use24HourClockCheckbox_Disable">
<owner>michaelpg@chromium.org</owner>
<description>Settings: Date and time: Use 24-hour clock</description>
Expand Down

0 comments on commit 6b19b3f

Please sign in to comment.