| OLD | NEW |
| 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/browser_window_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #import "base/auto_reset.h" | 9 #import "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 458 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
| 459 [center removeObserver:self | 459 [center removeObserver:self |
| 460 name:NSWindowWillCloseNotification | 460 name:NSWindowWillCloseNotification |
| 461 object:[notification object]]; | 461 object:[notification object]]; |
| 462 [self releaseBarVisibilityForOwner:[notification object] | 462 [self releaseBarVisibilityForOwner:[notification object] |
| 463 withAnimation:YES | 463 withAnimation:YES |
| 464 delay:YES]; | 464 delay:YES]; |
| 465 } | 465 } |
| 466 | 466 |
| 467 - (void)configurePresentationModeController { | 467 - (void)configurePresentationModeController { |
| 468 BOOL fullscreenForTab = [self isFullscreenForTabContent]; | 468 BOOL fullscreenForTab = [self isFullscreenForTabContentOrExtension]; |
| 469 BOOL kioskMode = | 469 BOOL kioskMode = |
| 470 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); | 470 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); |
| 471 BOOL showDropdown = | 471 BOOL showDropdown = |
| 472 !fullscreenForTab && !kioskMode && ([self floatingBarHasFocus]); | 472 !fullscreenForTab && !kioskMode && ([self floatingBarHasFocus]); |
| 473 | 473 |
| 474 PermissionBubbleManager* manager = [self permissionBubbleManager]; | 474 PermissionBubbleManager* manager = [self permissionBubbleManager]; |
| 475 if (manager && manager->IsBubbleVisible()) { | 475 if (manager && manager->IsBubbleVisible()) { |
| 476 NSWindow* bubbleWindow = manager->GetBubbleWindow(); | 476 NSWindow* bubbleWindow = manager->GetBubbleWindow(); |
| 477 DCHECK(bubbleWindow); | 477 DCHECK(bubbleWindow); |
| 478 // A visible permission bubble will force the dropdown to remain | 478 // A visible permission bubble will force the dropdown to remain |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 [sheetController unhideSheetForFullscreenTransition]; | 842 [sheetController unhideSheetForFullscreenTransition]; |
| 843 } | 843 } |
| 844 | 844 |
| 845 - (void)adjustUIForExitingFullscreen { | 845 - (void)adjustUIForExitingFullscreen { |
| 846 exclusiveAccessController_->Destroy(); | 846 exclusiveAccessController_->Destroy(); |
| 847 [self adjustUIForExitingFullscreenAndStopOmniboxSliding]; | 847 [self adjustUIForExitingFullscreenAndStopOmniboxSliding]; |
| 848 } | 848 } |
| 849 | 849 |
| 850 - (void)adjustUIForEnteringFullscreen { | 850 - (void)adjustUIForEnteringFullscreen { |
| 851 fullscreen_mac::SlidingStyle style; | 851 fullscreen_mac::SlidingStyle style; |
| 852 if ([self isFullscreenForTabContent]) { | 852 if ([self isFullscreenForTabContentOrExtension]) { |
| 853 style = fullscreen_mac::OMNIBOX_TABS_NONE; | 853 style = fullscreen_mac::OMNIBOX_TABS_NONE; |
| 854 } else if (enteringPresentationMode_ || ![self shouldShowFullscreenToolbar]) { | 854 } else if (enteringPresentationMode_ || ![self shouldShowFullscreenToolbar]) { |
| 855 style = fullscreen_mac::OMNIBOX_TABS_HIDDEN; | 855 style = fullscreen_mac::OMNIBOX_TABS_HIDDEN; |
| 856 } else { | 856 } else { |
| 857 style = fullscreen_mac::OMNIBOX_TABS_PRESENT; | 857 style = fullscreen_mac::OMNIBOX_TABS_PRESENT; |
| 858 } | 858 } |
| 859 | 859 |
| 860 [self adjustUIForSlidingFullscreenStyle:style]; | 860 [self adjustUIForSlidingFullscreenStyle:style]; |
| 861 } | 861 } |
| 862 | 862 |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 - (WebContents*)webContents { | 1238 - (WebContents*)webContents { |
| 1239 return browser_->tab_strip_model()->GetActiveWebContents(); | 1239 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 1240 } | 1240 } |
| 1241 | 1241 |
| 1242 - (PermissionBubbleManager*)permissionBubbleManager { | 1242 - (PermissionBubbleManager*)permissionBubbleManager { |
| 1243 if (WebContents* contents = [self webContents]) | 1243 if (WebContents* contents = [self webContents]) |
| 1244 return PermissionBubbleManager::FromWebContents(contents); | 1244 return PermissionBubbleManager::FromWebContents(contents); |
| 1245 return nil; | 1245 return nil; |
| 1246 } | 1246 } |
| 1247 | 1247 |
| 1248 - (BOOL)isFullscreenForTabContent { | 1248 - (BOOL)isFullscreenForTabContentOrExtension { |
| 1249 return browser_->exclusive_access_manager() | 1249 FullscreenController* controller = |
| 1250 ->fullscreen_controller() | 1250 browser_->exclusive_access_manager()->fullscreen_controller(); |
| 1251 ->IsWindowFullscreenForTabOrPending(); | 1251 return controller->IsWindowFullscreenForTabOrPending() || |
| 1252 controller->IsExtensionFullscreenOrPending(); |
| 1252 } | 1253 } |
| 1253 | 1254 |
| 1254 @end // @implementation BrowserWindowController(Private) | 1255 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |