Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4284)

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 2741343008: [Mac] Add Home button to Default Touch Bar (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index a95e21b64b6382618001255f03f5ec6fab4546d9..7c345b7e27ef9a53da68ea6312118942a7163450 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1007,8 +1007,7 @@ bool IsTabDetachingInFullscreenEnabled() {
[toolbarController_ setStarredState:isStarred];
[touchBar_ setIsStarred:isStarred];
- if ([[self window] respondsToSelector:@selector(setTouchBar:)])
- [[self window] performSelector:@selector(setTouchBar:) withObject:nil];
+ [self invalidateTouchBar];
}
- (void)setCurrentPageIsTranslated:(BOOL)on {
@@ -1147,8 +1146,7 @@ bool IsTabDetachingInFullscreenEnabled() {
- (void)setIsLoading:(BOOL)isLoading force:(BOOL)force {
[toolbarController_ setIsLoading:isLoading force:force];
[touchBar_ setIsPageLoading:isLoading];
- if ([[self window] respondsToSelector:@selector(setTouchBar:)])
- [[self window] performSelector:@selector(setTouchBar:) withObject:nil];
+ [self invalidateTouchBar];
}
// Make the location bar the first responder, if possible.
@@ -1851,13 +1849,19 @@ willAnimateFromState:(BookmarkBar::State)oldState
- (BrowserWindowTouchBar*)browserWindowTouchBar {
if (!touchBar_) {
- touchBar_.reset(
- [[BrowserWindowTouchBar alloc] initWithBrowser:browser_.get()]);
+ touchBar_.reset([[BrowserWindowTouchBar alloc]
+ initWithBrowser:browser_.get()
+ browserWindowController:self]);
}
return touchBar_.get();
}
+- (void)invalidateTouchBar {
+ if ([[self window] respondsToSelector:@selector(setTouchBar:)])
+ [[self window] performSelector:@selector(setTouchBar:) withObject:nil];
+}
+
@end // @implementation BrowserWindowController
@implementation BrowserWindowController(Fullscreen)
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | chrome/browser/ui/cocoa/browser_window_touch_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698