Windows: Fix VS2015 build errors in the binary distribution (issue #1692)

This commit is contained in:
Marshall Greenblatt
2015-08-20 10:20:21 -04:00
parent cd7e0eef20
commit fda35eae80
7 changed files with 50 additions and 51 deletions

View File

@@ -336,9 +336,9 @@ CefRefPtr<CefDragData> DataObjectToDragData(IDataObject* data_object) {
HDROP hdrop = (HDROP)hGlobal;
const int kMaxFilenameLen = 4096;
const unsigned num_files = DragQueryFileW(hdrop, 0xffffffff, 0, 0);
for (unsigned int i = 0; i < num_files; ++i) {
for (unsigned int x = 0; x < num_files; ++x) {
wchar_t filename[kMaxFilenameLen];
if (!DragQueryFileW(hdrop, i, filename, kMaxFilenameLen))
if (!DragQueryFileW(hdrop, x, filename, kMaxFilenameLen))
continue;
WCHAR* name = wcsrchr(filename, '\\');
drag_data->AddFile(filename, (name ? name + 1 : filename));

View File

@@ -80,7 +80,7 @@ class DropTargetWin : public IDropTarget {
DWORD* effect);
DEFAULT_QUERY_INTERFACE(IDropTarget)
IUNKNOWN_IMPLEMENTATION()
IUNKNOWN_IMPLEMENTATION
protected:
DropTargetWin(OsrDragEvents* callback, HWND hWnd)
@@ -106,7 +106,8 @@ class DropSourceWin : public IDropSource {
HRESULT __stdcall QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState);
DEFAULT_QUERY_INTERFACE(IDropSource)
IUNKNOWN_IMPLEMENTATION()
IUNKNOWN_IMPLEMENTATION
protected:
explicit DropSourceWin() : ref_count_(0) {}
virtual ~DropSourceWin() {}
@@ -137,7 +138,7 @@ class DragEnumFormatEtc : public IEnumFORMATETC {
static void DeepCopyFormatEtc(FORMATETC *dest, FORMATETC *source);
DEFAULT_QUERY_INTERFACE(IEnumFORMATETC)
IUNKNOWN_IMPLEMENTATION()
IUNKNOWN_IMPLEMENTATION
private:
ULONG m_nIndex; // current enumerator index
@@ -171,7 +172,7 @@ class DataObjectWin : public IDataObject {
HRESULT __stdcall GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium);
DEFAULT_QUERY_INTERFACE(IDataObject)
IUNKNOWN_IMPLEMENTATION()
IUNKNOWN_IMPLEMENTATION
protected:
int m_nNumFormats;

View File

@@ -509,7 +509,6 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) {
last_click_time_ = currentTime;
last_click_button_ = btnType;
CefRefPtr<CefBrowserHost> browser_host = browser_->GetHost();
if (browser_host) {
CefMouseEvent mouse_event;
mouse_event.x = x;

View File

@@ -319,11 +319,11 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings) {
if (with_controls_) {
// Create the child controls.
int x = 0;
int x_offset = 0;
static int button_width = GetButtonWidth();
static int urlbar_height = GetURLBarHeight();
static int font_height =
const int button_width = GetButtonWidth();
const int urlbar_height = GetURLBarHeight();
const int font_height =
LogicalToDevice(14, client::GetDeviceScaleFactor());
// Create a scaled font.
@@ -335,46 +335,46 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings) {
back_hwnd_ = CreateWindow(
L"BUTTON", L"Back",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED,
x, 0, button_width, urlbar_height,
x_offset, 0, button_width, urlbar_height,
hwnd_, reinterpret_cast<HMENU>(IDC_NAV_BACK), hInstance, 0);
CHECK(back_hwnd_);
SendMessage(back_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
x += button_width;
x_offset += button_width;
forward_hwnd_ = CreateWindow(
L"BUTTON", L"Forward",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED,
x, 0, button_width, urlbar_height,
x_offset, 0, button_width, urlbar_height,
hwnd_, reinterpret_cast<HMENU>(IDC_NAV_FORWARD), hInstance, 0);
CHECK(forward_hwnd_);
SendMessage(forward_hwnd_, WM_SETFONT,
reinterpret_cast<WPARAM>(font_), TRUE);
x += button_width;
x_offset += button_width;
reload_hwnd_ = CreateWindow(
L"BUTTON", L"Reload",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON| WS_DISABLED,
x, 0, button_width, urlbar_height,
x_offset, 0, button_width, urlbar_height,
hwnd_, reinterpret_cast<HMENU>(IDC_NAV_RELOAD), hInstance, 0);
CHECK(reload_hwnd_);
SendMessage(reload_hwnd_, WM_SETFONT,
reinterpret_cast<WPARAM>(font_), TRUE);
x += button_width;
x_offset += button_width;
stop_hwnd_ = CreateWindow(
L"BUTTON", L"Stop",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED,
x, 0, button_width, urlbar_height,
x_offset, 0, button_width, urlbar_height,
hwnd_, reinterpret_cast<HMENU>(IDC_NAV_STOP), hInstance, 0);
CHECK(stop_hwnd_);
SendMessage(stop_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
x += button_width;
x_offset += button_width;
edit_hwnd_ = CreateWindow(
L"EDIT", 0,
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL |
ES_AUTOHSCROLL| WS_DISABLED,
x, 0, rect.right - button_width * 4, urlbar_height,
x_offset, 0, rect.right - button_width * 4, urlbar_height,
hwnd_, 0, hInstance, 0);
SendMessage(edit_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
CHECK(edit_hwnd_);

View File

@@ -103,13 +103,13 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
CEF_REQUIRE_UI_THREAD();
// Only handle messages from the test URL.
const std::string& url = frame->GetURL();
std::string url = frame->GetURL();
if (url.find(kTestUrl) != 0)
return false;
const std::string& message_name = request;
if (message_name.find(kTestMessageName) == 0) {
const std::string& url = message_name.substr(sizeof(kTestMessageName));
url = message_name.substr(sizeof(kTestMessageName));
CancelPendingRequest();
@@ -119,20 +119,20 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
callback_ = callback;
// Create a CefRequest for the specified URL.
CefRefPtr<CefRequest> request = CefRequest::Create();
request->SetURL(url);
request->SetMethod("GET");
CefRefPtr<CefRequest> cef_request = CefRequest::Create();
cef_request->SetURL(url);
cef_request->SetMethod("GET");
// Callback to be executed on request completion.
// It's safe to use base::Unretained() here because there is only one
// RequestClient pending at any given time and we explicitly detach the
// callback in the Handler destructor.
const RequestClient::Callback& callback =
const RequestClient::Callback& request_callback =
base::Bind(&Handler::OnRequestComplete, base::Unretained(this));
// Create and start the new CefURLRequest.
urlrequest_ = CefURLRequest::Create(request,
new RequestClient(callback),
urlrequest_ = CefURLRequest::Create(cef_request,
new RequestClient(request_callback),
NULL);
return true;