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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 | 828 |
829 void NativeAppWindowCocoa::RenderViewCreated(content::RenderViewHost* rvh) { | 829 void NativeAppWindowCocoa::RenderViewCreated(content::RenderViewHost* rvh) { |
830 if (IsActive()) | 830 if (IsActive()) |
831 web_contents()->GetView()->RestoreFocus(); | 831 web_contents()->GetView()->RestoreFocus(); |
832 } | 832 } |
833 | 833 |
834 bool NativeAppWindowCocoa::IsFrameless() const { | 834 bool NativeAppWindowCocoa::IsFrameless() const { |
835 return !has_frame_; | 835 return !has_frame_; |
836 } | 836 } |
837 | 837 |
| 838 bool NativeAppWindowCocoa::HasFrameColor() const { |
| 839 // TODO(benwells): Implement this. |
| 840 return false; |
| 841 } |
| 842 |
| 843 SkColor NativeAppWindowCocoa::FrameColor() const { |
| 844 // TODO(benwells): Implement this. |
| 845 return SkColor(); |
| 846 } |
| 847 |
838 gfx::Insets NativeAppWindowCocoa::GetFrameInsets() const { | 848 gfx::Insets NativeAppWindowCocoa::GetFrameInsets() const { |
839 if (!has_frame_) | 849 if (!has_frame_) |
840 return gfx::Insets(); | 850 return gfx::Insets(); |
841 | 851 |
842 // Flip the coordinates based on the main screen. | 852 // Flip the coordinates based on the main screen. |
843 NSInteger screen_height = | 853 NSInteger screen_height = |
844 NSHeight([[[NSScreen screens] objectAtIndex:0] frame]); | 854 NSHeight([[[NSScreen screens] objectAtIndex:0] frame]); |
845 | 855 |
846 NSRect frame_nsrect = [window() frame]; | 856 NSRect frame_nsrect = [window() frame]; |
847 gfx::Rect frame_rect(NSRectToCGRect(frame_nsrect)); | 857 gfx::Rect frame_rect(NSRectToCGRect(frame_nsrect)); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 [window() setContentMinSize:NSMakeSize(min_size.width(), min_size.height())]; | 1038 [window() setContentMinSize:NSMakeSize(min_size.width(), min_size.height())]; |
1029 | 1039 |
1030 gfx::Size max_size = app_window_->size_constraints().GetMaximumSize(); | 1040 gfx::Size max_size = app_window_->size_constraints().GetMaximumSize(); |
1031 const int kUnboundedSize = AppWindow::SizeConstraints::kUnboundedSize; | 1041 const int kUnboundedSize = AppWindow::SizeConstraints::kUnboundedSize; |
1032 CGFloat max_width = max_size.width() == kUnboundedSize ? | 1042 CGFloat max_width = max_size.width() == kUnboundedSize ? |
1033 CGFLOAT_MAX : max_size.width(); | 1043 CGFLOAT_MAX : max_size.width(); |
1034 CGFloat max_height = max_size.height() == kUnboundedSize ? | 1044 CGFloat max_height = max_size.height() == kUnboundedSize ? |
1035 CGFLOAT_MAX : max_size.height(); | 1045 CGFLOAT_MAX : max_size.height(); |
1036 [window() setContentMaxSize:NSMakeSize(max_width, max_height)]; | 1046 [window() setContentMaxSize:NSMakeSize(max_width, max_height)]; |
1037 } | 1047 } |
OLD | NEW |