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

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

Issue 2086273003: [Mac] Reveal Fullscreen Toolbar for Tab Strip Changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scoped_nsobject Created 4 years, 6 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/presentation_mode_controller.mm
diff --git a/chrome/browser/ui/cocoa/presentation_mode_controller.mm b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
index c068ea4d021ee4e42ec0abeab9af180f36cffb3e..be1943b18ee118a2e820ad2ddb1fcffd6a518dd5 100644
--- a/chrome/browser/ui/cocoa/presentation_mode_controller.mm
+++ b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
@@ -30,6 +30,9 @@ const NSTimeInterval kMouseExitCheckDelay = 0.1;
const NSTimeInterval kDropdownShowDelay = 0.3;
const NSTimeInterval kDropdownHideDelay = 0.2;
+// The duration the toolbar is revealed for tab strip changes.
+const NSTimeInterval kDropdownForTabStripChangesDuration = 0.75;
+
// The event kind value for a undocumented menubar show/hide Carbon event.
const CGFloat kMenuBarRevealEventKind = 2004;
@@ -383,6 +386,16 @@ OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
currentAnimation_.reset();
}
+- (void)revealToolbarForTabStripChanges {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableFullscreenToolbarReveal)) {
+ return;
+ }
+
+ revealToolbarForTabStripChanges_ = YES;
+ [self ensureOverlayShownWithAnimation:YES delay:NO];
+}
+
- (void)setSystemFullscreenModeTo:(base::mac::FullScreenMode)mode {
if (mode == systemFullscreenMode_)
return;
@@ -485,6 +498,20 @@ OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
// Don't automatically set up a new tracking area. When explicitly stopped,
// either another animation is going to start immediately or the state will be
// changed immediately.
+ if (revealToolbarForTabStripChanges_) {
+ if (toolbarFraction_ > 0.0) {
+ // Set the timer to hide the toolbar.
+ [hideTimer_ invalidate];
+ hideTimer_.reset([[NSTimer
+ scheduledTimerWithTimeInterval:kDropdownForTabStripChangesDuration
+ target:self
+ selector:@selector(hideTimerFire:)
+ userInfo:nil
+ repeats:NO] retain]);
+ } else {
+ revealToolbarForTabStripChanges_ = NO;
+ }
+ }
}
- (void)animationDidEnd:(NSAnimation*)animation {
« no previous file with comments | « chrome/browser/ui/cocoa/presentation_mode_controller.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698