OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/views/apps/glass_app_window_frame_view_win.h" | 5 #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h" |
6 | 6 |
7 #include "apps/ui/native_app_window.h" | 7 #include "apps/ui/native_app_window.h" |
8 #include "ui/base/hit_test.h" | 8 #include "ui/base/hit_test.h" |
9 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
10 #include "ui/views/widget/widget_delegate.h" | 10 #include "ui/views/widget/widget_delegate.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return kViewClassName; | 109 return kViewClassName; |
110 } | 110 } |
111 | 111 |
112 gfx::Size GlassAppWindowFrameViewWin::GetMinimumSize() const { | 112 gfx::Size GlassAppWindowFrameViewWin::GetMinimumSize() const { |
113 gfx::Size min_size = widget_->client_view()->GetMinimumSize(); | 113 gfx::Size min_size = widget_->client_view()->GetMinimumSize(); |
114 gfx::Rect client_bounds = GetBoundsForClientView(); | 114 gfx::Rect client_bounds = GetBoundsForClientView(); |
115 min_size.Enlarge(0, client_bounds.y()); | 115 min_size.Enlarge(0, client_bounds.y()); |
116 return min_size; | 116 return min_size; |
117 } | 117 } |
118 | 118 |
119 gfx::Size GlassAppWindowFrameViewWin::GetMaximumSize() { | 119 gfx::Size GlassAppWindowFrameViewWin::GetMaximumSize() const { |
120 gfx::Size max_size = widget_->client_view()->GetMaximumSize(); | 120 gfx::Size max_size = widget_->client_view()->GetMaximumSize(); |
121 | 121 |
122 // Add to the client maximum size the height of any title bar and borders. | 122 // Add to the client maximum size the height of any title bar and borders. |
123 gfx::Size client_size = GetBoundsForClientView().size(); | 123 gfx::Size client_size = GetBoundsForClientView().size(); |
124 if (max_size.width()) | 124 if (max_size.width()) |
125 max_size.Enlarge(width() - client_size.width(), 0); | 125 max_size.Enlarge(width() - client_size.width(), 0); |
126 if (max_size.height()) | 126 if (max_size.height()) |
127 max_size.Enlarge(0, height() - client_size.height()); | 127 max_size.Enlarge(0, height() - client_size.height()); |
128 | 128 |
129 return max_size; | 129 return max_size; |
130 } | 130 } |
OLD | NEW |