Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm

Issue 166443004: Add frame color option to packaged app windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698