OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h" |
6 | 6 |
7 #include "apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 } | 420 } |
421 | 421 |
422 bool NativeAppWindowCocoa::IsMinimized() const { | 422 bool NativeAppWindowCocoa::IsMinimized() const { |
423 return [window() isMiniaturized]; | 423 return [window() isMiniaturized]; |
424 } | 424 } |
425 | 425 |
426 bool NativeAppWindowCocoa::IsFullscreen() const { | 426 bool NativeAppWindowCocoa::IsFullscreen() const { |
427 return is_fullscreen_; | 427 return is_fullscreen_; |
428 } | 428 } |
429 | 429 |
430 void NativeAppWindowCocoa::SetFullscreen(bool fullscreen) { | 430 void NativeAppWindowCocoa::SetFullscreen(int fullscreen_types) { |
| 431 bool fullscreen = (fullscreen_types != ShellWindow::FULLSCREEN_TYPE_NONE); |
431 if (fullscreen == is_fullscreen_) | 432 if (fullscreen == is_fullscreen_) |
432 return; | 433 return; |
433 is_fullscreen_ = fullscreen; | 434 is_fullscreen_ = fullscreen; |
434 | 435 |
435 if (base::mac::IsOSLionOrLater()) { | 436 if (base::mac::IsOSLionOrLater()) { |
436 // If going fullscreen, but the window is constrained (fullscreen UI control | 437 // If going fullscreen, but the window is constrained (fullscreen UI control |
437 // is disabled), temporarily enable it. It will be disabled again on leaving | 438 // is disabled), temporarily enable it. It will be disabled again on leaving |
438 // fullscreen. | 439 // fullscreen. |
439 if (fullscreen && !shows_fullscreen_controls_) | 440 if (fullscreen && !shows_fullscreen_controls_) |
440 SetFullScreenCollectionBehavior(window(), true); | 441 SetFullScreenCollectionBehavior(window(), true); |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 [window() setContentMinSize:NSMakeSize(min_size.width(), min_size.height())]; | 1010 [window() setContentMinSize:NSMakeSize(min_size.width(), min_size.height())]; |
1010 | 1011 |
1011 gfx::Size max_size = shell_window_->size_constraints().GetMaximumSize(); | 1012 gfx::Size max_size = shell_window_->size_constraints().GetMaximumSize(); |
1012 const int kUnboundedSize = ShellWindow::SizeConstraints::kUnboundedSize; | 1013 const int kUnboundedSize = ShellWindow::SizeConstraints::kUnboundedSize; |
1013 CGFloat max_width = max_size.width() == kUnboundedSize ? | 1014 CGFloat max_width = max_size.width() == kUnboundedSize ? |
1014 CGFLOAT_MAX : max_size.width(); | 1015 CGFLOAT_MAX : max_size.width(); |
1015 CGFloat max_height = max_size.height() == kUnboundedSize ? | 1016 CGFloat max_height = max_size.height() == kUnboundedSize ? |
1016 CGFLOAT_MAX : max_size.height(); | 1017 CGFLOAT_MAX : max_size.height(); |
1017 [window() setContentMaxSize:NSMakeSize(max_width, max_height)]; | 1018 [window() setContentMaxSize:NSMakeSize(max_width, max_height)]; |
1018 } | 1019 } |
OLD | NEW |