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 "extensions/browser/app_window/native_app_window.h" | 7 #include "extensions/browser/app_window/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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 gfx::Insets insets = GetGlassInsets(); | 49 gfx::Insets insets = GetGlassInsets(); |
50 return gfx::Rect(insets.left(), | 50 return gfx::Rect(insets.left(), |
51 insets.top(), | 51 insets.top(), |
52 std::max(0, width() - insets.left() - insets.right()), | 52 std::max(0, width() - insets.left() - insets.right()), |
53 std::max(0, height() - insets.top() - insets.bottom())); | 53 std::max(0, height() - insets.top() - insets.bottom())); |
54 } | 54 } |
55 | 55 |
56 gfx::Rect GlassAppWindowFrameViewWin::GetWindowBoundsForClientBounds( | 56 gfx::Rect GlassAppWindowFrameViewWin::GetWindowBoundsForClientBounds( |
57 const gfx::Rect& client_bounds) const { | 57 const gfx::Rect& client_bounds) const { |
| 58 if (widget_->IsFullscreen()) |
| 59 return bounds(); |
| 60 |
58 gfx::Insets insets = GetGlassInsets(); | 61 gfx::Insets insets = GetGlassInsets(); |
59 // Our bounds are not the same as the window's due to the offset added by | 62 // Our bounds are not the same as the window's due to the offset added by |
60 // AppWindowDesktopWindowTreeHostWin::GetClientAreaInsets. So account for it | 63 // AppWindowDesktopWindowTreeHostWin::GetClientAreaInsets. So account for it |
61 // here. | 64 // here. |
62 insets += gfx::Insets(0, 0, 1, 1); | 65 insets += gfx::Insets(0, 0, 1, 1); |
63 return gfx::Rect(client_bounds.x() - insets.left(), | 66 return gfx::Rect(client_bounds.x() - insets.left(), |
64 client_bounds.y() - insets.top(), | 67 client_bounds.y() - insets.top(), |
65 client_bounds.width() + insets.left() + insets.right(), | 68 client_bounds.width() + insets.left() + insets.right(), |
66 client_bounds.height() + insets.top() + insets.bottom()); | 69 client_bounds.height() + insets.top() + insets.bottom()); |
67 } | 70 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 gfx::Size max_size = widget_->client_view()->GetMaximumSize(); | 133 gfx::Size max_size = widget_->client_view()->GetMaximumSize(); |
131 | 134 |
132 gfx::Insets insets = GetGlassInsets(); | 135 gfx::Insets insets = GetGlassInsets(); |
133 if (max_size.width()) | 136 if (max_size.width()) |
134 max_size.Enlarge(insets.left() + insets.right(), 0); | 137 max_size.Enlarge(insets.left() + insets.right(), 0); |
135 if (max_size.height()) | 138 if (max_size.height()) |
136 max_size.Enlarge(0, insets.top() + insets.bottom()); | 139 max_size.Enlarge(0, insets.top() + insets.bottom()); |
137 | 140 |
138 return max_size; | 141 return max_size; |
139 } | 142 } |
OLD | NEW |