Chromium Code Reviews| 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/gfx/win/dpi.h" | 9 #include "ui/gfx/win/dpi.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 .size(); | 108 .size(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 const char* GlassAppWindowFrameViewWin::GetClassName() const { | 111 const char* GlassAppWindowFrameViewWin::GetClassName() const { |
| 112 return kViewClassName; | 112 return kViewClassName; |
| 113 } | 113 } |
| 114 | 114 |
| 115 gfx::Size GlassAppWindowFrameViewWin::GetMinimumSize() const { | 115 gfx::Size GlassAppWindowFrameViewWin::GetMinimumSize() const { |
| 116 gfx::Size min_size = widget_->client_view()->GetMinimumSize(); | 116 gfx::Size min_size = widget_->client_view()->GetMinimumSize(); |
| 117 gfx::Rect client_bounds = GetBoundsForClientView(); | 117 gfx::Rect client_bounds = GetBoundsForClientView(); |
| 118 min_size.Enlarge(0, client_bounds.y()); | 118 min_size.Enlarge(width() - client_bounds.width(), |
| 119 height() - client_bounds.height()); | |
|
benwells1
2014/07/22 05:37:52
This looks right. Are there tests which should hav
jackhou1
2014/07/23 03:36:04
The API is covered in platform_apps/window_api/tes
| |
| 119 return min_size; | 120 return min_size; |
| 120 } | 121 } |
| 121 | 122 |
| 122 gfx::Size GlassAppWindowFrameViewWin::GetMaximumSize() const { | 123 gfx::Size GlassAppWindowFrameViewWin::GetMaximumSize() const { |
| 123 gfx::Size max_size = widget_->client_view()->GetMaximumSize(); | 124 gfx::Size max_size = widget_->client_view()->GetMaximumSize(); |
| 124 | 125 |
| 125 // Add to the client maximum size the height of any title bar and borders. | 126 // Add to the client maximum size the height of any title bar and borders. |
| 126 gfx::Size client_size = GetBoundsForClientView().size(); | 127 gfx::Size client_size = GetBoundsForClientView().size(); |
| 127 if (max_size.width()) | 128 if (max_size.width()) |
| 128 max_size.Enlarge(width() - client_size.width(), 0); | 129 max_size.Enlarge(width() - client_size.width(), 0); |
| 129 if (max_size.height()) | 130 if (max_size.height()) |
| 130 max_size.Enlarge(0, height() - client_size.height()); | 131 max_size.Enlarge(0, height() - client_size.height()); |
| 131 | 132 |
| 132 return max_size; | 133 return max_size; |
| 133 } | 134 } |
| OLD | NEW |