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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // Caption is a safe default. | 91 // Caption is a safe default. |
92 return HTCAPTION; | 92 return HTCAPTION; |
93 } | 93 } |
94 | 94 |
95 void GlassAppWindowFrameViewWin::GetWindowMask(const gfx::Size& size, | 95 void GlassAppWindowFrameViewWin::GetWindowMask(const gfx::Size& size, |
96 gfx::Path* window_mask) { | 96 gfx::Path* window_mask) { |
97 // We got nothing to say about no window mask. | 97 // We got nothing to say about no window mask. |
98 } | 98 } |
99 | 99 |
100 gfx::Size GlassAppWindowFrameViewWin::GetPreferredSize() { | 100 gfx::Size GlassAppWindowFrameViewWin::GetPreferredSize() const { |
101 gfx::Size pref = widget_->client_view()->GetPreferredSize(); | 101 gfx::Size pref = widget_->client_view()->GetPreferredSize(); |
102 gfx::Rect bounds(0, 0, pref.width(), pref.height()); | 102 gfx::Rect bounds(0, 0, pref.width(), pref.height()); |
103 return widget_->non_client_view() | 103 return widget_->non_client_view() |
104 ->GetWindowBoundsForClientBounds(bounds) | 104 ->GetWindowBoundsForClientBounds(bounds) |
105 .size(); | 105 .size(); |
106 } | 106 } |
107 | 107 |
108 const char* GlassAppWindowFrameViewWin::GetClassName() const { | 108 const char* GlassAppWindowFrameViewWin::GetClassName() const { |
109 return kViewClassName; | 109 return kViewClassName; |
110 } | 110 } |
111 | 111 |
112 gfx::Size GlassAppWindowFrameViewWin::GetMinimumSize() { | 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() { |
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 |