Chromium Code Reviews| 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 return false; | |
|
Matt Giuca
2014/02/18 06:03:18
// TODO(benwells)...
benwells
2014/02/18 07:47:25
Done.
| |
| 840 } | |
| 841 | |
| 842 SkColor NativeAppWindowCocoa::FrameColor() const { | |
| 843 return SkColor(); | |
|
Matt Giuca
2014/02/18 06:03:18
// TODO(benwells)...
benwells
2014/02/18 07:47:25
Done.
| |
| 844 } | |
| 845 | |
| 838 gfx::Insets NativeAppWindowCocoa::GetFrameInsets() const { | 846 gfx::Insets NativeAppWindowCocoa::GetFrameInsets() const { |
| 839 if (!has_frame_) | 847 if (!has_frame_) |
| 840 return gfx::Insets(); | 848 return gfx::Insets(); |
| 841 | 849 |
| 842 // Flip the coordinates based on the main screen. | 850 // Flip the coordinates based on the main screen. |
| 843 NSInteger screen_height = | 851 NSInteger screen_height = |
| 844 NSHeight([[[NSScreen screens] objectAtIndex:0] frame]); | 852 NSHeight([[[NSScreen screens] objectAtIndex:0] frame]); |
| 845 | 853 |
| 846 NSRect frame_nsrect = [window() frame]; | 854 NSRect frame_nsrect = [window() frame]; |
| 847 gfx::Rect frame_rect(NSRectToCGRect(frame_nsrect)); | 855 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())]; | 1036 [window() setContentMinSize:NSMakeSize(min_size.width(), min_size.height())]; |
| 1029 | 1037 |
| 1030 gfx::Size max_size = app_window_->size_constraints().GetMaximumSize(); | 1038 gfx::Size max_size = app_window_->size_constraints().GetMaximumSize(); |
| 1031 const int kUnboundedSize = AppWindow::SizeConstraints::kUnboundedSize; | 1039 const int kUnboundedSize = AppWindow::SizeConstraints::kUnboundedSize; |
| 1032 CGFloat max_width = max_size.width() == kUnboundedSize ? | 1040 CGFloat max_width = max_size.width() == kUnboundedSize ? |
| 1033 CGFLOAT_MAX : max_size.width(); | 1041 CGFLOAT_MAX : max_size.width(); |
| 1034 CGFloat max_height = max_size.height() == kUnboundedSize ? | 1042 CGFloat max_height = max_size.height() == kUnboundedSize ? |
| 1035 CGFLOAT_MAX : max_size.height(); | 1043 CGFLOAT_MAX : max_size.height(); |
| 1036 [window() setContentMaxSize:NSMakeSize(max_width, max_height)]; | 1044 [window() setContentMaxSize:NSMakeSize(max_width, max_height)]; |
| 1037 } | 1045 } |
| OLD | NEW |