OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/base/win/hwnd_util.h" | 5 #include "ui/base/win/hwnd_util.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "gfx/rect.h" | 8 #include "ui/gfx/rect.h" |
9 #include "gfx/size.h" | 9 #include "ui/gfx/size.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Adjust the window to fit, returning true if the window was resized or moved. | 15 // Adjust the window to fit, returning true if the window was resized or moved. |
16 bool AdjustWindowToFit(HWND hwnd, const RECT& bounds) { | 16 bool AdjustWindowToFit(HWND hwnd, const RECT& bounds) { |
17 // Get the monitor. | 17 // Get the monitor. |
18 HMONITOR hmon = MonitorFromRect(&bounds, MONITOR_DEFAULTTONEAREST); | 18 HMONITOR hmon = MonitorFromRect(&bounds, MONITOR_DEFAULTTONEAREST); |
19 if (!hmon) { | 19 if (!hmon) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 window_bounds.right - window_bounds.left, | 158 window_bounds.right - window_bounds.left, |
159 window_bounds.bottom - window_bounds.top, | 159 window_bounds.bottom - window_bounds.top, |
160 SWP_NOACTIVATE | SWP_NOZORDER); | 160 SWP_NOACTIVATE | SWP_NOZORDER); |
161 } // else case, AdjustWindowToFit set the bounds for us. | 161 } // else case, AdjustWindowToFit set the bounds for us. |
162 } else { | 162 } else { |
163 NOTREACHED() << "Unable to adjust window to fit"; | 163 NOTREACHED() << "Unable to adjust window to fit"; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 } // namespace ui | 167 } // namespace ui |
OLD | NEW |