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

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

Issue 2467833003: [Mac] Move the fullscreen toolbar style to FullscreenToolbarController (Closed)
Patch Set: Updated comments and fixed tests Created 4 years, 1 month 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 b40f64ee8424a11b424c4d9e4685c1f67019ddb4..6ec3c39a86790b6b59b75b3cca0520547ada47f1 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -338,6 +338,9 @@ bool IsTabDetachingInFullscreenEnabled() {
[[InfoBarContainerController alloc] initWithResizeDelegate:self]);
[self updateInfoBarTipVisibility];
+ fullscreenToolbarController_.reset(
+ [[FullscreenToolbarController alloc] initWithBrowserController:self]);
+
// We don't want to try and show the bar before it gets placed in its parent
// view, so this step shoudn't be inside the bookmark bar controller's
// |-awakeFromNib|.
@@ -383,9 +386,6 @@ bool IsTabDetachingInFullscreenEnabled() {
extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS,
windowShim_.get()));
- PrefService* prefs = browser_->profile()->GetPrefs();
- shouldShowFullscreenToolbar_ =
- prefs->GetBoolean(prefs::kShowFullscreenToolbar);
blockLayoutSubviews_ = NO;
// We are done initializing now.
@@ -1828,16 +1828,7 @@ willAnimateFromState:(BookmarkBar::State)oldState
- (void)updateUIForTabFullscreen:
(ExclusiveAccessContext::TabFullscreenState)state {
DCHECK([self isInAnyFullscreenMode]);
- if (state == ExclusiveAccessContext::STATE_ENTER_TAB_FULLSCREEN) {
- [self adjustUIForSlidingFullscreenStyle:FullscreenSlidingStyle::
- OMNIBOX_TABS_NONE];
- return;
- }
-
- [self adjustUIForSlidingFullscreenStyle:
- shouldShowFullscreenToolbar_
- ? FullscreenSlidingStyle::OMNIBOX_TABS_PRESENT
- : FullscreenSlidingStyle::OMNIBOX_TABS_HIDDEN];
+ [fullscreenToolbarController_ updateToolbarStyle];
}
- (void)updateFullscreenExitBubble {
@@ -1854,17 +1845,6 @@ willAnimateFromState:(BookmarkBar::State)oldState
return NO;
}
-- (void)setFullscreenToolbarVisible:(BOOL)visible {
- if (shouldShowFullscreenToolbar_ == visible)
- return;
-
- shouldShowFullscreenToolbar_ = visible;
- [self adjustUIForSlidingFullscreenStyle:
- shouldShowFullscreenToolbar_
- ? FullscreenSlidingStyle::OMNIBOX_TABS_PRESENT
- : FullscreenSlidingStyle::OMNIBOX_TABS_HIDDEN];
-}
-
- (BOOL)isInAnyFullscreenMode {
return [self isInImmersiveFullscreen] || [self isInAppKitFullscreen];
}
@@ -1957,6 +1937,13 @@ willAnimateFromState:(BookmarkBar::State)oldState
return [focused isKindOfClass:[AutocompleteTextFieldEditor class]];
}
+- (BOOL)isFullscreenForTabContentOrExtension {
+ FullscreenController* controller =
+ browser_->exclusive_access_manager()->fullscreen_controller();
+ return controller->IsWindowFullscreenForTabOrPending() ||
+ controller->IsExtensionFullscreenOrPending();
+}
+
- (ExclusiveAccessController*)exclusiveAccessController {
return exclusiveAccessController_.get();
}

Powered by Google App Engine
This is Rietveld 408576698