Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 if (chrome::mac::SupportsSystemFullscreen() && base::mac::IsOSLionOrLater()) |
|
Robert Sesek
2015/10/08 15:21:22
Is the condition after && necessary?
spqchan
2015/10/08 16:54:28
It's not. I removed it
| |
| 1972 [self enterAppKitFullscreen]; | |
| 1973 else | |
| 1974 [self enterImmersiveFullscreen]; | |
| 1975 | |
| 1970 if (!url.is_empty()) | 1976 if (!url.is_empty()) |
| 1971 [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType]; | 1977 [self updateFullscreenExitBubbleURL:url bubbleType:bubbleType]; |
| 1972 } | 1978 } |
| 1973 | 1979 |
| 1974 - (void)exitAnyFullscreen { | 1980 - (void)exitAnyFullscreen { |
| 1975 // TODO(erikchen): Fullscreen modes should stack. Should be able to exit | 1981 // TODO(erikchen): Fullscreen modes should stack. Should be able to exit |
| 1976 // Immersive Fullscreen and still be in AppKit Fullscreen. | 1982 // Immersive Fullscreen and still be in AppKit Fullscreen. |
| 1977 if ([self isInAppKitFullscreen]) | 1983 if ([self isInAppKitFullscreen]) |
| 1978 [self exitAppKitFullscreen]; | 1984 [self exitAppKitFullscreen]; |
| 1979 if ([self isInImmersiveFullscreen]) | 1985 if ([self isInImmersiveFullscreen]) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2061 | 2067 |
| 2062 - (BOOL)supportsBookmarkBar { | 2068 - (BOOL)supportsBookmarkBar { |
| 2063 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2069 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2064 } | 2070 } |
| 2065 | 2071 |
| 2066 - (BOOL)isTabbedWindow { | 2072 - (BOOL)isTabbedWindow { |
| 2067 return browser_->is_type_tabbed(); | 2073 return browser_->is_type_tabbed(); |
| 2068 } | 2074 } |
| 2069 | 2075 |
| 2070 @end // @implementation BrowserWindowController(WindowType) | 2076 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |