Chromium Code Reviews| 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 0eb187b785ad44495fbc36443fe210202ad25d4b..8eb5e33483f860be98b81797d55f224be16794d3 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_controller.mm |
| +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm |
| @@ -48,6 +48,7 @@ |
| #import "chrome/browser/ui/cocoa/browser_window_command_handler.h" |
| #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
| #import "chrome/browser/ui/cocoa/browser_window_layout.h" |
| +#import "chrome/browser/ui/cocoa/browser_window_touch_bar.h" |
| #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
| #import "chrome/browser/ui/cocoa/dev_tools_controller.h" |
| #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
| @@ -96,6 +97,7 @@ |
| #include "content/public/browser/web_contents.h" |
| #import "ui/base/cocoa/cocoa_base_utils.h" |
| #import "ui/base/cocoa/nsview_additions.h" |
| +#import "ui/base/cocoa/touch_bar_forward_declarations.h" |
| #include "ui/base/material_design/material_design_controller.h" |
| #include "ui/display/screen.h" |
| #import "ui/gfx/mac/coordinate_conversion.h" |
| @@ -385,6 +387,8 @@ bool IsTabDetachingInFullscreenEnabled() { |
| extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS, |
| windowShim_.get())); |
| + touchBar_.reset([[BrowserWindowTouchBar alloc] initWithBrowser:browser]); |
|
Robert Sesek
2017/02/14 17:32:50
Can we avoid creating this if it's not necessary?
spqchan
2017/02/16 15:25:51
I moved things around so it's only created when it
Robert Sesek
2017/02/16 18:19:38
I meant create a convenience class constructor rat
|
| + |
| blockLayoutSubviews_ = NO; |
| // We are done initializing now. |
| @@ -1003,6 +1007,9 @@ bool IsTabDetachingInFullscreenEnabled() { |
| - (void)setStarredState:(BOOL)isStarred { |
| [toolbarController_ setStarredState:isStarred]; |
| + [touchBar_ setIsStarred:isStarred]; |
| + if ([[self window] respondsToSelector:@selector(setTouchBar:)]) |
| + [[self window] performSelector:@selector(setTouchBar:) withObject:nil]; |
| } |
| - (void)setCurrentPageIsTranslated:(BOOL)on { |
| @@ -1144,6 +1151,9 @@ 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]; |
| } |
| // Make the location bar the first responder, if possible. |
| @@ -1850,6 +1860,10 @@ willAnimateFromState:(BookmarkBar::State)oldState |
| return static_cast<BrowserWindowCocoa*>([self browserWindow])->alert_state(); |
| } |
| +- (BrowserWindowTouchBar*)browserWindowTouchBar { |
| + return touchBar_.get(); |
| +} |
| + |
| @end // @implementation BrowserWindowController |
| @implementation BrowserWindowController(Fullscreen) |