mac: remove touchbar metrics code
Nobody ever looks at these and they expired a month ago. Fixed: 1349032 Change-Id: I0ba6f65aba7249f62f6a052624f3ddd429bfeb65 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3949542 Reviewed-by: Robert Sesek <rsesek@chromium.org> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org> Cr-Commit-Position: refs/heads/main@{#1058790}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
cacd1346cc
commit
cf2b889531
chrome/browser/ui/cocoa/touchbar
browser_window_default_touch_bar.mmcredit_card_autofill_touch_bar_controller.mmcredit_card_autofill_touch_bar_controller_unittest.mm
content/app_shim_remote_cocoa
tools/metrics/histograms
ui/base/cocoa
@ -114,30 +114,6 @@ NSButton* CreateTouchBarButton(const gfx::VectorIcon& icon,
|
|||||||
owner, command, tooltip_id);
|
owner, command, tooltip_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::TouchBarAction TouchBarActionFromCommand(int command) {
|
|
||||||
switch (command) {
|
|
||||||
case IDC_BACK:
|
|
||||||
return ui::TouchBarAction::BACK;
|
|
||||||
case IDC_FORWARD:
|
|
||||||
return ui::TouchBarAction::FORWARD;
|
|
||||||
case IDC_STOP:
|
|
||||||
return ui::TouchBarAction::STOP;
|
|
||||||
case IDC_RELOAD:
|
|
||||||
return ui::TouchBarAction::RELOAD;
|
|
||||||
case IDC_HOME:
|
|
||||||
return ui::TouchBarAction::HOME;
|
|
||||||
case IDC_FOCUS_LOCATION:
|
|
||||||
return ui::TouchBarAction::SEARCH;
|
|
||||||
case IDC_BOOKMARK_THIS_TAB:
|
|
||||||
return ui::TouchBarAction::STAR;
|
|
||||||
case IDC_NEW_TAB:
|
|
||||||
return ui::TouchBarAction::NEW_TAB;
|
|
||||||
default:
|
|
||||||
NOTREACHED();
|
|
||||||
return ui::TouchBarAction::TOUCH_BAR_ACTION_COUNT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A class registered for C++ notifications. This is used to detect changes in
|
// A class registered for C++ notifications. This is used to detect changes in
|
||||||
// the profile preferences and the back/forward commands.
|
// the profile preferences and the back/forward commands.
|
||||||
class TouchBarNotificationBridge : public CommandObserver,
|
class TouchBarNotificationBridge : public CommandObserver,
|
||||||
@ -612,7 +588,6 @@ class TouchBarNotificationBridge : public CommandObserver,
|
|||||||
|
|
||||||
- (void)executeCommand:(id)sender {
|
- (void)executeCommand:(id)sender {
|
||||||
int command = [sender tag];
|
int command = [sender tag];
|
||||||
ui::LogTouchBarUMA(TouchBarActionFromCommand(command));
|
|
||||||
_browser->command_controller()->ExecuteCommand(command);
|
_browser->command_controller()->ExecuteCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,6 @@ NSImage* GetCreditCardTouchBarImage(int iconId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)acceptCreditCard:(id)sender {
|
- (void)acceptCreditCard:(id)sender {
|
||||||
ui::LogTouchBarUMA(ui::TouchBarAction::CREDIT_CARD_AUTOFILL);
|
|
||||||
_controller->AcceptSuggestion([sender tag]);
|
_controller->AcceptSuggestion([sender tag]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include "base/mac/mac_util.h"
|
#include "base/mac/mac_util.h"
|
||||||
#include "base/mac/scoped_nsobject.h"
|
#include "base/mac/scoped_nsobject.h"
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#include "base/test/metrics/histogram_tester.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
|
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
|
||||||
#import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h"
|
#import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h"
|
||||||
@ -164,15 +163,4 @@ TEST_F(CreditCardAutofillTouchBarControllerUnitTest, CreditCardButtonCheck) {
|
|||||||
EXPECT_EQ("bufflehead canvasback", base::SysNSStringToUTF8([button title]));
|
EXPECT_EQ("bufflehead canvasback", base::SysNSStringToUTF8([button title]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests that the touch bar histogram is logged correctly.
|
|
||||||
TEST_F(CreditCardAutofillTouchBarControllerUnitTest, TouchBarMetric) {
|
|
||||||
{
|
|
||||||
base::HistogramTester histogram_tester;
|
|
||||||
[touch_bar_controller_ acceptCreditCard:nil];
|
|
||||||
histogram_tester.ExpectBucketCount("TouchBar.Default.Metrics",
|
|
||||||
ui::TouchBarAction::CREDIT_CARD_AUTOFILL,
|
|
||||||
1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -500,8 +500,6 @@ void ExtractUnderlines(NSAttributedString* string,
|
|||||||
replacementRange.location += _availableTextOffset;
|
replacementRange.location += _availableTextOffset;
|
||||||
[self insertText:selectedResult.replacementString
|
[self insertText:selectedResult.replacementString
|
||||||
replacementRange:replacementRange];
|
replacementRange:replacementRange];
|
||||||
|
|
||||||
ui::LogTouchBarUMA(ui::TouchBarAction::TEXT_SUGGESTION);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)candidateListTouchBarItem:(NSCandidateListTouchBarItem*)anItem
|
- (void)candidateListTouchBarItem:(NSCandidateListTouchBarItem*)anItem
|
||||||
|
@ -24716,19 +24716,6 @@ Called by update_debug_scenarios.py.-->
|
|||||||
<int value="8" label="DSP set to new engine with no previous value in prefs"/>
|
<int value="8" label="DSP set to new engine with no previous value in prefs"/>
|
||||||
</enum>
|
</enum>
|
||||||
|
|
||||||
<enum name="DefaultTouchBarActions">
|
|
||||||
<int value="0" label="Back"/>
|
|
||||||
<int value="1" label="Forward"/>
|
|
||||||
<int value="2" label="Stop"/>
|
|
||||||
<int value="3" label="Reload"/>
|
|
||||||
<int value="4" label="Home"/>
|
|
||||||
<int value="5" label="Search"/>
|
|
||||||
<int value="6" label="Star"/>
|
|
||||||
<int value="7" label="New Tab"/>
|
|
||||||
<int value="8" label="Credit Card Autofill"/>
|
|
||||||
<int value="9" label="Text Suggestion"/>
|
|
||||||
</enum>
|
|
||||||
|
|
||||||
<enum name="DefaultWebClientState">
|
<enum name="DefaultWebClientState">
|
||||||
<int value="0" label="Not default">Chrome is not the default web client.</int>
|
<int value="0" label="Not default">Chrome is not the default web client.</int>
|
||||||
<int value="1" label="Is default">Chrome is the default web client.</int>
|
<int value="1" label="Is default">Chrome is the default web client.</int>
|
||||||
|
@ -13979,13 +13979,6 @@ should be kept until we use this API. -->
|
|||||||
</summary>
|
</summary>
|
||||||
</histogram>
|
</histogram>
|
||||||
|
|
||||||
<histogram name="TouchBar.Default.Metrics" enum="DefaultTouchBarActions"
|
|
||||||
expires_after="2022-09-11">
|
|
||||||
<owner>ellyjones@chromium.org</owner>
|
|
||||||
<owner>chrome-mac-dev@google.com</owner>
|
|
||||||
<summary>Tracks the usage of the default touch bar buttons.</summary>
|
|
||||||
</histogram>
|
|
||||||
|
|
||||||
<histogram name="Touchpad.Acceleration.Changed" enum="BooleanEnabled"
|
<histogram name="Touchpad.Acceleration.Changed" enum="BooleanEnabled"
|
||||||
expires_after="M87">
|
expires_after="M87">
|
||||||
<owner>zentaro@chromium.org</owner>
|
<owner>zentaro@chromium.org</owner>
|
||||||
|
@ -12,25 +12,6 @@
|
|||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
// The touch bar actions that are being recorded in a histogram. These values
|
|
||||||
// should not be re-ordered or removed.
|
|
||||||
enum TouchBarAction {
|
|
||||||
BACK = 0,
|
|
||||||
FORWARD,
|
|
||||||
STOP,
|
|
||||||
RELOAD,
|
|
||||||
HOME,
|
|
||||||
SEARCH,
|
|
||||||
STAR,
|
|
||||||
NEW_TAB,
|
|
||||||
CREDIT_CARD_AUTOFILL,
|
|
||||||
TEXT_SUGGESTION,
|
|
||||||
TOUCH_BAR_ACTION_COUNT
|
|
||||||
};
|
|
||||||
|
|
||||||
// Logs the sample's UMA metrics into the DefaultTouchBar.Metrics histogram.
|
|
||||||
COMPONENT_EXPORT(UI_BASE) void LogTouchBarUMA(TouchBarAction command);
|
|
||||||
|
|
||||||
// Creates a touch bar identifier with the given |id|.
|
// Creates a touch bar identifier with the given |id|.
|
||||||
COMPONENT_EXPORT(UI_BASE) NSString* GetTouchBarId(NSString* touch_bar_id);
|
COMPONENT_EXPORT(UI_BASE) NSString* GetTouchBarId(NSString* touch_bar_id);
|
||||||
|
|
||||||
|
@ -5,16 +5,10 @@
|
|||||||
#import "ui/base/cocoa/touch_bar_util.h"
|
#import "ui/base/cocoa/touch_bar_util.h"
|
||||||
|
|
||||||
#include "base/mac/foundation_util.h"
|
#include "base/mac/foundation_util.h"
|
||||||
#include "base/metrics/histogram_macros.h"
|
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
void LogTouchBarUMA(TouchBarAction command) {
|
|
||||||
UMA_HISTOGRAM_ENUMERATION("TouchBar.Default.Metrics", command,
|
|
||||||
TOUCH_BAR_ACTION_COUNT);
|
|
||||||
}
|
|
||||||
|
|
||||||
NSString* GetTouchBarId(NSString* touch_bar_id) {
|
NSString* GetTouchBarId(NSString* touch_bar_id) {
|
||||||
NSString* chrome_bundle_id =
|
NSString* chrome_bundle_id =
|
||||||
base::SysUTF8ToNSString(base::mac::BaseBundleID());
|
base::SysUTF8ToNSString(base::mac::BaseBundleID());
|
||||||
|
Reference in New Issue
Block a user