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

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

Issue 2695493002: [Mac] Touch Bar support for default browser window state (Closed)
Patch Set: Rebased Created 3 years, 10 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
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_touch_bar_unittest.mm ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/framed_browser_window.mm
diff --git a/chrome/browser/ui/cocoa/framed_browser_window.mm b/chrome/browser/ui/cocoa/framed_browser_window.mm
index 65e14a23e2979575da4ec570af4bf26dacbcaae7..881800329d2dd40428c2ba808c9e694a035cdb24 100644
--- a/chrome/browser/ui/cocoa/framed_browser_window.mm
+++ b/chrome/browser/ui/cocoa/framed_browser_window.mm
@@ -9,6 +9,7 @@
#include <stddef.h>
#include "base/logging.h"
+#include "base/mac/foundation_util.h"
#include "base/mac/sdk_forward_declarations.h"
#include "chrome/browser/global_keyboard_shortcuts_mac.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
@@ -16,6 +17,7 @@
#include "chrome/browser/themes/theme_service.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.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"
#include "chrome/browser/ui/cocoa/l10n_util.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
@@ -24,7 +26,7 @@
#include "ui/base/cocoa/cocoa_base_utils.h"
#include "ui/base/cocoa/nsgraphics_context_additions.h"
#import "ui/base/cocoa/nsview_additions.h"
-#include "ui/base/material_design/material_design_controller.h"
+#import "ui/base/cocoa/touch_bar_forward_declarations.h"
// Implementer's note: Moving the window controls is tricky. When altering the
// code, ensure that:
@@ -408,7 +410,8 @@ const CGFloat kWindowGradientHeight = 24.0;
// width and some padding. The new avatar button is displayed to the right
// of the fullscreen icon, so it doesn't need to be shifted.
BrowserWindowController* bwc =
- static_cast<BrowserWindowController*>([self windowController]);
+ base::mac::ObjCCastStrict<BrowserWindowController>(
+ [self windowController]);
if ([bwc shouldShowAvatar] && ![bwc shouldUseNewAvatarButton]) {
NSView* avatarButton = [[bwc avatarButtonController] view];
origin.x = -(NSWidth([avatarButton frame]) + 3);
@@ -500,6 +503,13 @@ const CGFloat kWindowGradientHeight = 24.0;
return themed;
}
+- (NSTouchBar*)makeTouchBar {
+ BrowserWindowController* bwc =
+ base::mac::ObjCCastStrict<BrowserWindowController>(
+ [self windowController]);
+ return [[bwc browserWindowTouchBar] makeTouchBar];
+}
+
- (NSColor*)titleColor {
const ui::ThemeProvider* themeProvider = [self themeProvider];
if (!themeProvider)
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_touch_bar_unittest.mm ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698