| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #include "components/translate/core/browser/translate_ui_delegate.h" | 92 #include "components/translate/core/browser/translate_ui_delegate.h" |
| 93 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 93 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 94 #include "content/public/browser/render_view_host.h" | 94 #include "content/public/browser/render_view_host.h" |
| 95 #include "content/public/browser/render_widget_host.h" | 95 #include "content/public/browser/render_widget_host.h" |
| 96 #include "content/public/browser/render_widget_host_view.h" | 96 #include "content/public/browser/render_widget_host_view.h" |
| 97 #include "content/public/browser/web_contents.h" | 97 #include "content/public/browser/web_contents.h" |
| 98 #import "ui/base/cocoa/cocoa_base_utils.h" | 98 #import "ui/base/cocoa/cocoa_base_utils.h" |
| 99 #import "ui/base/cocoa/nsview_additions.h" | 99 #import "ui/base/cocoa/nsview_additions.h" |
| 100 #include "ui/base/l10n/l10n_util.h" | 100 #include "ui/base/l10n/l10n_util.h" |
| 101 #include "ui/base/l10n/l10n_util_mac.h" | 101 #include "ui/base/l10n/l10n_util_mac.h" |
| 102 #include "ui/display/screen.h" |
| 102 #import "ui/gfx/mac/coordinate_conversion.h" | 103 #import "ui/gfx/mac/coordinate_conversion.h" |
| 103 #include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h" | 104 #include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h" |
| 104 #include "ui/gfx/screen.h" | |
| 105 | 105 |
| 106 using bookmarks::BookmarkModel; | 106 using bookmarks::BookmarkModel; |
| 107 using bookmarks::BookmarkNode; | 107 using bookmarks::BookmarkNode; |
| 108 using l10n_util::GetStringUTF16; | 108 using l10n_util::GetStringUTF16; |
| 109 using l10n_util::GetNSStringWithFixup; | 109 using l10n_util::GetNSStringWithFixup; |
| 110 using l10n_util::GetNSStringFWithFixup; | 110 using l10n_util::GetNSStringFWithFixup; |
| 111 | 111 |
| 112 // ORGANIZATION: This is a big file. It is (in principle) organized as follows | 112 // ORGANIZATION: This is a big file. It is (in principle) organized as follows |
| 113 // (in order): | 113 // (in order): |
| 114 // 1. Interfaces. Very short, one-time-use classes may include an implementation | 114 // 1. Interfaces. Very short, one-time-use classes may include an implementation |
| (...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1932 DCHECK(!exclusiveAccessController_->url().is_empty()); | 1932 DCHECK(!exclusiveAccessController_->url().is_empty()); |
| 1933 [self updateFullscreenExitBubble]; | 1933 [self updateFullscreenExitBubble]; |
| 1934 } | 1934 } |
| 1935 } | 1935 } |
| 1936 | 1936 |
| 1937 - (void)enterWebContentFullscreen { | 1937 - (void)enterWebContentFullscreen { |
| 1938 // HTML5 Fullscreen should only use AppKit fullscreen in 10.10+. | 1938 // HTML5 Fullscreen should only use AppKit fullscreen in 10.10+. |
| 1939 // However, if the user is using multiple monitors and turned off | 1939 // However, if the user is using multiple monitors and turned off |
| 1940 // "Separate Space in Each Display", use Immersive Fullscreen so | 1940 // "Separate Space in Each Display", use Immersive Fullscreen so |
| 1941 // that the other monitors won't blank out. | 1941 // that the other monitors won't blank out. |
| 1942 gfx::Screen* screen = gfx::Screen::GetScreen(); | 1942 display::Screen* screen = display::Screen::GetScreen(); |
| 1943 BOOL hasMultipleMonitors = screen && screen->GetNumDisplays() > 1; | 1943 BOOL hasMultipleMonitors = screen && screen->GetNumDisplays() > 1; |
| 1944 if (chrome::mac::SupportsSystemFullscreen() && | 1944 if (chrome::mac::SupportsSystemFullscreen() && |
| 1945 base::mac::IsOSYosemiteOrLater() && | 1945 base::mac::IsOSYosemiteOrLater() && |
| 1946 !(hasMultipleMonitors && ![NSScreen screensHaveSeparateSpaces])) { | 1946 !(hasMultipleMonitors && ![NSScreen screensHaveSeparateSpaces])) { |
| 1947 [self enterAppKitFullscreen]; | 1947 [self enterAppKitFullscreen]; |
| 1948 } else { | 1948 } else { |
| 1949 [self enterImmersiveFullscreen]; | 1949 [self enterImmersiveFullscreen]; |
| 1950 } | 1950 } |
| 1951 | 1951 |
| 1952 if (!exclusiveAccessController_->url().is_empty()) | 1952 if (!exclusiveAccessController_->url().is_empty()) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2062 | 2062 |
| 2063 - (BOOL)isTabbedWindow { | 2063 - (BOOL)isTabbedWindow { |
| 2064 return browser_->is_type_tabbed(); | 2064 return browser_->is_type_tabbed(); |
| 2065 } | 2065 } |
| 2066 | 2066 |
| 2067 - (NSRect)savedRegularWindowFrame { | 2067 - (NSRect)savedRegularWindowFrame { |
| 2068 return savedRegularWindowFrame_; | 2068 return savedRegularWindowFrame_; |
| 2069 } | 2069 } |
| 2070 | 2070 |
| 2071 @end // @implementation BrowserWindowController(WindowType) | 2071 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |