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

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

Issue 484613002: Move apps::SizeConstraints to extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: extensions/browser/app_window Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h ('k') | extensions/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 const gfx::Size& min_size, const gfx::Size& max_size) { 932 const gfx::Size& min_size, const gfx::Size& max_size) {
933 // Update the size constraints. 933 // Update the size constraints.
934 size_constraints_.set_minimum_size(min_size); 934 size_constraints_.set_minimum_size(min_size);
935 size_constraints_.set_maximum_size(max_size); 935 size_constraints_.set_maximum_size(max_size);
936 936
937 gfx::Size minimum_size = size_constraints_.GetMinimumSize(); 937 gfx::Size minimum_size = size_constraints_.GetMinimumSize();
938 [window() setContentMinSize:NSMakeSize(minimum_size.width(), 938 [window() setContentMinSize:NSMakeSize(minimum_size.width(),
939 minimum_size.height())]; 939 minimum_size.height())];
940 940
941 gfx::Size maximum_size = size_constraints_.GetMaximumSize(); 941 gfx::Size maximum_size = size_constraints_.GetMaximumSize();
942 const int kUnboundedSize = apps::SizeConstraints::kUnboundedSize; 942 const int kUnboundedSize = extensions::SizeConstraints::kUnboundedSize;
943 CGFloat max_width = maximum_size.width() == kUnboundedSize ? 943 CGFloat max_width = maximum_size.width() == kUnboundedSize ?
944 CGFLOAT_MAX : maximum_size.width(); 944 CGFLOAT_MAX : maximum_size.width();
945 CGFloat max_height = maximum_size.height() == kUnboundedSize ? 945 CGFloat max_height = maximum_size.height() == kUnboundedSize ?
946 CGFLOAT_MAX : maximum_size.height(); 946 CGFLOAT_MAX : maximum_size.height();
947 [window() setContentMaxSize:NSMakeSize(max_width, max_height)]; 947 [window() setContentMaxSize:NSMakeSize(max_width, max_height)];
948 948
949 // Update the window controls. 949 // Update the window controls.
950 shows_resize_controls_ = 950 shows_resize_controls_ =
951 is_resizable_ && !size_constraints_.HasFixedSize(); 951 is_resizable_ && !size_constraints_.HasFixedSize();
952 shows_fullscreen_controls_ = 952 shows_fullscreen_controls_ =
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 } 988 }
989 989
990 void NativeAppWindowCocoa::UpdateRestoredBounds() { 990 void NativeAppWindowCocoa::UpdateRestoredBounds() {
991 if (IsRestored(*this)) 991 if (IsRestored(*this))
992 restored_bounds_ = [window() frame]; 992 restored_bounds_ = [window() frame];
993 } 993 }
994 994
995 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { 995 void NativeAppWindowCocoa::HideWithoutMarkingHidden() {
996 [window() orderOut:window_controller_]; 996 [window() orderOut:window_controller_];
997 } 997 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h ('k') | extensions/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698