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

Side by Side Diff: chrome/browser/ui/cocoa/fullscreen_toolbar_controller.mm

Issue 2491343003: [Mac] Fix for fullscreen toolbar layout issues (Closed)
Patch Set: Fix for avi 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h" 5 #import "chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #import "base/mac/mac_util.h" 10 #import "base/mac/mac_util.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 - (void)dealloc { 54 - (void)dealloc {
55 DCHECK(!inFullscreenMode_); 55 DCHECK(!inFullscreenMode_);
56 [super dealloc]; 56 [super dealloc];
57 } 57 }
58 58
59 - (void)enterFullscreenMode { 59 - (void)enterFullscreenMode {
60 DCHECK(!inFullscreenMode_); 60 DCHECK(!inFullscreenMode_);
61 inFullscreenMode_ = YES; 61 inFullscreenMode_ = YES;
62 62
63 [self updateToolbarStyle]; 63 [self updateToolbarStyleExitingTabFullscreen:NO];
64 64
65 if ([browserController_ isInImmersiveFullscreen]) { 65 if ([browserController_ isInImmersiveFullscreen]) {
66 immersiveFullscreenController_.reset([[ImmersiveFullscreenController alloc] 66 immersiveFullscreenController_.reset([[ImmersiveFullscreenController alloc]
67 initWithBrowserController:browserController_]); 67 initWithBrowserController:browserController_]);
68 [immersiveFullscreenController_ updateMenuBarAndDockVisibility]; 68 [immersiveFullscreenController_ updateMenuBarAndDockVisibility];
69 } else { 69 } else {
70 menubarTracker_.reset([[FullscreenMenubarTracker alloc] 70 menubarTracker_.reset([[FullscreenMenubarTracker alloc]
71 initWithFullscreenToolbarController:self]); 71 initWithFullscreenToolbarController:self]);
72 mouseTracker_.reset([[FullscreenToolbarMouseTracker alloc] 72 mouseTracker_.reset([[FullscreenToolbarMouseTracker alloc]
73 initWithFullscreenToolbarController:self 73 initWithFullscreenToolbarController:self
(...skipping 23 matching lines...) Expand all
97 97
98 - (void)revealToolbarForTabStripChanges { 98 - (void)revealToolbarForTabStripChanges {
99 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 99 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
100 switches::kEnableFullscreenToolbarReveal)) { 100 switches::kEnableFullscreenToolbarReveal)) {
101 return; 101 return;
102 } 102 }
103 103
104 animationController_->AnimateToolbarForTabstripChanges(); 104 animationController_->AnimateToolbarForTabstripChanges();
105 } 105 }
106 106
107 - (void)updateToolbarStyle { 107 - (void)updateToolbarStyleExitingTabFullscreen:(BOOL)isExitingTabFullscreen {
108 FullscreenToolbarStyle oldStyle = toolbarStyle_; 108 FullscreenToolbarStyle oldStyle = toolbarStyle_;
109 109
110 if ([browserController_ isFullscreenForTabContentOrExtension]) { 110 if ([browserController_ isFullscreenForTabContentOrExtension] &&
111 !isExitingTabFullscreen) {
111 toolbarStyle_ = FullscreenToolbarStyle::TOOLBAR_NONE; 112 toolbarStyle_ = FullscreenToolbarStyle::TOOLBAR_NONE;
112 } else { 113 } else {
113 PrefService* prefs = [browserController_ profile]->GetPrefs(); 114 PrefService* prefs = [browserController_ profile]->GetPrefs();
114 toolbarStyle_ = prefs->GetBoolean(prefs::kShowFullscreenToolbar) 115 toolbarStyle_ = prefs->GetBoolean(prefs::kShowFullscreenToolbar)
115 ? FullscreenToolbarStyle::TOOLBAR_PRESENT 116 ? FullscreenToolbarStyle::TOOLBAR_PRESENT
116 : FullscreenToolbarStyle::TOOLBAR_HIDDEN; 117 : FullscreenToolbarStyle::TOOLBAR_HIDDEN;
117 } 118 }
118 119
119 if (oldStyle != toolbarStyle_) 120 if (oldStyle != toolbarStyle_)
120 [self updateToolbar]; 121 [self updateToolbar];
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 return inFullscreenMode_; 197 return inFullscreenMode_;
197 } 198 }
198 199
199 - (void)updateToolbarFrame:(NSRect)frame { 200 - (void)updateToolbarFrame:(NSRect)frame {
200 if (mouseTracker_.get()) 201 if (mouseTracker_.get())
201 [mouseTracker_ updateToolbarFrame:frame]; 202 [mouseTracker_ updateToolbarFrame:frame];
202 } 203 }
203 204
204 @end 205 @end
205 206
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698