From 37464c2a4c2e3b516e1409f777abb7754bfb84ae Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 28 Jan 2015 17:14:52 +0000 Subject: [PATCH] cefclient: Windows: Fix type conversion error (issue #1511). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2003 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- tests/cefclient/browser_window_std_win.cc | 8 ++++++-- tests/cefclient/osr_window_win.cc | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/cefclient/browser_window_std_win.cc b/tests/cefclient/browser_window_std_win.cc index fc88fa97c..90c33a0f0 100644 --- a/tests/cefclient/browser_window_std_win.cc +++ b/tests/cefclient/browser_window_std_win.cc @@ -45,7 +45,9 @@ void BrowserWindowStdWin::ShowPopup(HWND parent_hwnd, HWND hwnd = GetHWND(); if (hwnd) { SetParent(hwnd, parent_hwnd); - SetWindowPos(hwnd, NULL, x, y, width, height, SWP_NOZORDER); + SetWindowPos(hwnd, NULL, x, y, + static_cast(width), static_cast(height), + SWP_NOZORDER); ShowWindow(hwnd, SW_SHOW); } } @@ -76,7 +78,9 @@ void BrowserWindowStdWin::SetBounds(int x, int y, size_t width, size_t height) { HWND hwnd = GetHWND(); if (hwnd) { // Set the browser window bounds. - SetWindowPos(hwnd, NULL, x, y, width, height, SWP_NOZORDER); + SetWindowPos(hwnd, NULL, x, y, + static_cast(width), static_cast(height), + SWP_NOZORDER); } } diff --git a/tests/cefclient/osr_window_win.cc b/tests/cefclient/osr_window_win.cc index bd2ebc900..87e19c11d 100644 --- a/tests/cefclient/osr_window_win.cc +++ b/tests/cefclient/osr_window_win.cc @@ -114,7 +114,9 @@ void OsrWindowWin::ShowPopup(HWND parent_hwnd, DCHECK(browser_.get()); // Create the native window. - const RECT rect = {x, y, x + width, y + height}; + const RECT rect = {x, y, + x + static_cast(width), + y + static_cast(height)}; Create(parent_hwnd, rect); // Send resize notification so the compositor is assigned the correct @@ -178,7 +180,9 @@ void OsrWindowWin::SetBounds(int x, int y, size_t width, size_t height) { if (hwnd_) { // Set the browser window bounds. - ::SetWindowPos(hwnd_, NULL, x, y, width, height, SWP_NOZORDER); + ::SetWindowPos(hwnd_, NULL, x, y, + static_cast(width), static_cast(height), + SWP_NOZORDER); } }