Commit 489008ef authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Clean up touch_bar_util

GetBlueTouchBarButton() is unused; remove it.

Remove the wrapper functions that return the touchbar classes.
Chrome builds with a new enough SDK that they are not needed.

Bug: none
Change-Id: I19d25a92ce857b1bcced66b8905a22faf701da7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2459398
Auto-Submit: Avi Drissman <avi@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Reviewed-by: default avatarLeonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815140}
parent 06b5f213
......@@ -304,7 +304,7 @@ class API_AVAILABLE(macos(10.12.2)) TouchBarNotificationBridge
return [self createTabFullscreenTouchBar];
}
base::scoped_nsobject<NSTouchBar> touchBar([[ui::NSTouchBar() alloc] init]);
base::scoped_nsobject<NSTouchBar> touchBar([[NSTouchBar alloc] init]);
[touchBar
setCustomizationIdentifier:ui::GetTouchBarId(kBrowserWindowTouchBarId)];
[touchBar setDelegate:self];
......@@ -359,7 +359,7 @@ class API_AVAILABLE(macos(10.12.2)) TouchBarNotificationBridge
}
base::scoped_nsobject<NSCustomTouchBarItem> touchBarItem(
[[ui::NSCustomTouchBarItem() alloc] initWithIdentifier:identifier]);
[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]);
if ([identifier hasSuffix:kBackTouchId]) {
auto* button = CreateTouchBarButton(vector_icons::kBackArrowIcon, self,
IDC_BACK, IDS_ACCNAME_BACK);
......@@ -443,7 +443,7 @@ class API_AVAILABLE(macos(10.12.2)) TouchBarNotificationBridge
}
- (NSTouchBar*)createTabFullscreenTouchBar {
base::scoped_nsobject<NSTouchBar> touchBar([[ui::NSTouchBar() alloc] init]);
base::scoped_nsobject<NSTouchBar> touchBar([[NSTouchBar alloc] init]);
[touchBar setDelegate:self];
[touchBar setDefaultItemIdentifiers:@[ ui::GetTouchBarItemId(
kTabFullscreenTouchBarId,
......
......@@ -69,7 +69,7 @@ NSImage* GetCreditCardTouchBarImage(int iconId) {
return nil;
}
base::scoped_nsobject<NSTouchBar> touchBar([[ui::NSTouchBar() alloc] init]);
base::scoped_nsobject<NSTouchBar> touchBar([[NSTouchBar alloc] init]);
[touchBar setCustomizationIdentifier:ui::GetTouchBarId(
kCreditCardAutofillTouchBarId)];
[touchBar setDelegate:self];
......@@ -97,13 +97,13 @@ NSImage* GetCreditCardTouchBarImage(int iconId) {
kCreditCardTouchId),
i];
base::scoped_nsobject<NSCustomTouchBarItem> item(
[[ui::NSCustomTouchBarItem() alloc] initWithIdentifier:cardIdentifier]);
[[NSCustomTouchBarItem alloc] initWithIdentifier:cardIdentifier]);
[item setView:[self createCreditCardButtonAtRow:i]];
[creditCardItems addObject:item.autorelease()];
}
return [ui::NSGroupTouchBarItem() groupItemWithIdentifier:identifier
items:creditCardItems];
return [NSGroupTouchBarItem groupItemWithIdentifier:identifier
items:creditCardItems];
}
- (NSColor*)touchBarSubtextColor {
......
......@@ -31,21 +31,6 @@ enum TouchBarAction {
// Logs the sample's UMA metrics into the DefaultTouchBar.Metrics histogram.
COMPONENT_EXPORT(UI_BASE) void LogTouchBarUMA(TouchBarAction command);
// Returns the NSTouchBar Class.
COMPONENT_EXPORT(UI_BASE) Class NSTouchBar();
// Returns the NSCustomTouchBarItem Class.
COMPONENT_EXPORT(UI_BASE) Class NSCustomTouchBarItem();
// Returns the NSGroupTouchBarItem Class.
COMPONENT_EXPORT(UI_BASE) Class NSGroupTouchBarItem();
// Returns a stylized blue button for the touch bar. The button performs
// |action| from the |target|.
API_AVAILABLE(macosx(10.12.2))
COMPONENT_EXPORT(UI_BASE)
NSButton* GetBlueTouchBarButton(NSString* title, id target, SEL action);
// Creates a touch bar identifier with the given |id|.
COMPONENT_EXPORT(UI_BASE) NSString* GetTouchBarId(NSString* touch_bar_id);
......
......@@ -15,28 +15,6 @@ void LogTouchBarUMA(TouchBarAction command) {
TOUCH_BAR_ACTION_COUNT);
}
Class NSTouchBar() {
return NSClassFromString(@"NSTouchBar");
}
Class NSCustomTouchBarItem() {
return NSClassFromString(@"NSCustomTouchBarItem");
}
Class NSGroupTouchBarItem() {
return NSClassFromString(@"NSGroupTouchBarItem");
}
NSButton* GetBlueTouchBarButton(NSString* title, id target, SEL action) {
NSButton* button =
[NSButton buttonWithTitle:title target:target action:action];
[button setBezelColor:[NSColor colorWithSRGBRed:0.168
green:0.51
blue:0.843
alpha:1.0]];
return button;
}
NSString* GetTouchBarId(NSString* touch_bar_id) {
NSString* chrome_bundle_id =
base::SysUTF8ToNSString(base::mac::BaseBundleID());
......
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