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

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

Issue 2743633005: [Mac] Add Home button to Default Touch Bar (Closed)
Patch Set: Fix for rsesek 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 57efa23c3a539b33a5b809834e36bddee98065c2..9272b81ff4a8cf25d929f74d326bd76f5d438a2e 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1009,8 +1009,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 {
@@ -1153,8 +1152,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.
@@ -1859,13 +1857,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