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

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

Issue 1387473002: Switch HTML5 Fullscreen Over to AppKit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add check for 10.10+ Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <numeric> 8 #include <numeric>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 // on the window bounds to determine whether to show buttons or not. 414 // on the window bounds to determine whether to show buttons or not.
415 if ([self hasToolbar]) // Do not create the buttons in popups. 415 if ([self hasToolbar]) // Do not create the buttons in popups.
416 [toolbarController_ createBrowserActionButtons]; 416 [toolbarController_ createBrowserActionButtons];
417 417
418 extension_keybinding_registry_.reset( 418 extension_keybinding_registry_.reset(
419 new ExtensionKeybindingRegistryCocoa(browser_->profile(), 419 new ExtensionKeybindingRegistryCocoa(browser_->profile(),
420 [self window], 420 [self window],
421 extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS, 421 extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS,
422 windowShim_.get())); 422 windowShim_.get()));
423 423
424 blockLayoutSubviews_ = NO;
425
424 // We are done initializing now. 426 // We are done initializing now.
425 initializing_ = NO; 427 initializing_ = NO;
426 } 428 }
427 return self; 429 return self;
428 } 430 }
429 431
430 - (void)dealloc { 432 - (void)dealloc {
431 browser_->tab_strip_model()->CloseAllTabs(); 433 browser_->tab_strip_model()->CloseAllTabs();
432 434
433 // Explicitly release |presentationModeController_| here, as it may call back 435 // Explicitly release |presentationModeController_| here, as it may call back
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 [self enterBrowserFullscreenWithToolbar:NO]; 1961 [self enterBrowserFullscreenWithToolbar:NO];
1960 } else { 1962 } else {
1961 [self enterImmersiveFullscreen]; 1963 [self enterImmersiveFullscreen];
1962 DCHECK(!url.is_empty()); 1964 DCHECK(!url.is_empty());
1963 [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType]; 1965 [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType];
1964 } 1966 }
1965 } 1967 }
1966 1968
1967 - (void)enterWebContentFullscreenForURL:(const GURL&)url 1969 - (void)enterWebContentFullscreenForURL:(const GURL&)url
1968 bubbleType:(ExclusiveAccessBubbleType)bubbleType { 1970 bubbleType:(ExclusiveAccessBubbleType)bubbleType {
1969 [self enterImmersiveFullscreen]; 1971 // HTML5 Fullscreen should only use AppKit fullscreen in 10.10+.
1972 if (chrome::mac::SupportsSystemFullscreen() &&
1973 base::mac::IsOSYosemiteOrLater())
1974 [self enterAppKitFullscreen];
1975 else
1976 [self enterImmersiveFullscreen];
1977
1970 if (!url.is_empty()) 1978 if (!url.is_empty())
1971 [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType]; 1979 [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType];
1972 } 1980 }
1973 1981
1974 - (void)exitAnyFullscreen { 1982 - (void)exitAnyFullscreen {
1975 // TODO(erikchen): Fullscreen modes should stack. Should be able to exit 1983 // TODO(erikchen): Fullscreen modes should stack. Should be able to exit
1976 // Immersive Fullscreen and still be in AppKit Fullscreen. 1984 // Immersive Fullscreen and still be in AppKit Fullscreen.
1977 if ([self isInAppKitFullscreen]) 1985 if ([self isInAppKitFullscreen])
1978 [self exitAppKitFullscreen]; 1986 [self exitAppKitFullscreen];
1979 if ([self isInImmersiveFullscreen]) 1987 if ([self isInImmersiveFullscreen])
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
2061 2069
2062 - (BOOL)supportsBookmarkBar { 2070 - (BOOL)supportsBookmarkBar {
2063 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2071 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2064 } 2072 }
2065 2073
2066 - (BOOL)isTabbedWindow { 2074 - (BOOL)isTabbedWindow {
2067 return browser_->is_type_tabbed(); 2075 return browser_->is_type_tabbed();
2068 } 2076 }
2069 2077
2070 @end // @implementation BrowserWindowController(WindowType) 2078 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | chrome/browser/ui/cocoa/browser_window_controller_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698