| 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 "ui/platform_window/win/win_window.h" | 5 #include "ui/platform_window/win/win_window.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 void WinWindow::Hide() { | 69 void WinWindow::Hide() { |
| 70 ShowWindow(hwnd(), SW_HIDE); | 70 ShowWindow(hwnd(), SW_HIDE); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void WinWindow::Close() { | 73 void WinWindow::Close() { |
| 74 Destroy(); | 74 Destroy(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void WinWindow::PrepareForShutdown() {} |
| 78 |
| 77 void WinWindow::SetBounds(const gfx::Rect& bounds) { | 79 void WinWindow::SetBounds(const gfx::Rect& bounds) { |
| 78 gfx::Rect window_bounds = GetWindowBoundsForClientBounds( | 80 gfx::Rect window_bounds = GetWindowBoundsForClientBounds( |
| 79 GetWindowLong(hwnd(), GWL_STYLE), | 81 GetWindowLong(hwnd(), GWL_STYLE), |
| 80 GetWindowLong(hwnd(), GWL_EXSTYLE), | 82 GetWindowLong(hwnd(), GWL_EXSTYLE), |
| 81 bounds); | 83 bounds); |
| 82 unsigned int flags = SWP_NOREPOSITION; | 84 unsigned int flags = SWP_NOREPOSITION; |
| 83 if (!::IsWindowVisible(hwnd())) | 85 if (!::IsWindowVisible(hwnd())) |
| 84 flags |= SWP_NOACTIVATE; | 86 flags |= SWP_NOACTIVATE; |
| 85 SetWindowPos(hwnd(), NULL, window_bounds.x(), window_bounds.y(), | 87 SetWindowPos(hwnd(), NULL, window_bounds.x(), window_bounds.y(), |
| 86 window_bounds.width(), window_bounds.height(), flags); | 88 window_bounds.width(), window_bounds.height(), flags); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 198 |
| 197 namespace test { | 199 namespace test { |
| 198 | 200 |
| 199 // static | 201 // static |
| 200 void SetUsePopupAsRootWindowForTest(bool use) { | 202 void SetUsePopupAsRootWindowForTest(bool use) { |
| 201 use_popup_as_root_window_for_test = use; | 203 use_popup_as_root_window_for_test = use; |
| 202 } | 204 } |
| 203 | 205 |
| 204 } // namespace test | 206 } // namespace test |
| 205 } // namespace ui | 207 } // namespace ui |
| OLD | NEW |