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

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: Fixed test 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 51504cd893917d73a2c923b4325cf4595ec05366..eac0d846618e584a537e9d14e3f88e1a30633b95 100644
--- a/chrome/browser/ui/cocoa/presentation_mode_controller.mm
+++ b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
@@ -31,6 +31,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;
@@ -384,6 +387,16 @@ OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
currentAnimation_.reset();
}
+- (void)revealToolbarForTabStripChanges {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableFullscreenToolbarReveal)) {
+ return;
+ }
+
+ revealToolbarForTabStripChanges_ = YES;
+ [self ensureOverlayShownWithAnimation:YES delay:YES];
Robert Sesek 2016/06/23 14:08:24 What if multiple tabs are inserted and this method
spqchan 2016/06/23 19:41:52 If the method calls before it fires, then hideTime
+}
+
- (void)setSystemFullscreenModeTo:(base::mac::FullScreenMode)mode {
if (mode == systemFullscreenMode_)
return;
@@ -482,6 +495,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_ = false;
Robert Sesek 2016/06/23 14:08:24 false -> NO
spqchan 2016/06/23 19:41:52 Done.
+ }
+ }
}
- (void)animationDidEnd:(NSAnimation*)animation {

Powered by Google App Engine
This is Rietveld 408576698