Windows: Fix VS2015 build errors in the binary distribution (issue #1692)
This commit is contained in:
parent
cd7e0eef20
commit
fda35eae80
|
@ -161,8 +161,8 @@ class CefPoint : public CefStructBase<CefPointTraits> {
|
|||
}
|
||||
|
||||
bool IsEmpty() const { return x <= 0 && y <= 0; }
|
||||
void Set(int x, int y) {
|
||||
this->x = x, this->y = y;
|
||||
void Set(int x_val, int y_val) {
|
||||
x = x_val, y = y_val;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -202,8 +202,8 @@ class CefRect : public CefStructBase<CefRectTraits> {
|
|||
}
|
||||
|
||||
bool IsEmpty() const { return width <= 0 || height <= 0; }
|
||||
void Set(int x, int y, int width, int height) {
|
||||
this->x = x, this->y = y, this->width = width, this->height = height;
|
||||
void Set(int x_val, int y_val, int width_val, int height_val) {
|
||||
x = x_val, y = y_val, width = width_val, height = height_val;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -243,8 +243,8 @@ class CefSize : public CefStructBase<CefSizeTraits> {
|
|||
}
|
||||
|
||||
bool IsEmpty() const { return width <= 0 || height <= 0; }
|
||||
void Set(int width, int height) {
|
||||
this->width = width, this->height = height;
|
||||
void Set(int width_val, int height_val) {
|
||||
width = width_val, height = height_val;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -285,8 +285,8 @@ class CefDraggableRegion : public CefStructBase<CefDraggableRegionTraits> {
|
|||
Set(bounds, draggable);
|
||||
}
|
||||
|
||||
void Set(const CefRect& bounds, bool draggable) {
|
||||
this->bounds = bounds, this->draggable = draggable;
|
||||
void Set(const CefRect& bounds_val, bool draggable_val) {
|
||||
bounds = bounds_val, draggable = draggable_val;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -340,18 +340,18 @@ class CefScreenInfo : public CefStructBase<CefScreenInfoTraits> {
|
|||
is_monochrome, rect, available_rect);
|
||||
}
|
||||
|
||||
void Set(float device_scale_factor,
|
||||
int depth,
|
||||
int depth_per_component,
|
||||
bool is_monochrome,
|
||||
const CefRect& rect,
|
||||
const CefRect& available_rect) {
|
||||
this->device_scale_factor = device_scale_factor;
|
||||
this->depth = depth;
|
||||
this->depth_per_component = depth_per_component;
|
||||
this->is_monochrome = is_monochrome;
|
||||
this->rect = rect;
|
||||
this->available_rect = available_rect;
|
||||
void Set(float device_scale_factor_val,
|
||||
int depth_val,
|
||||
int depth_per_component_val,
|
||||
bool is_monochrome_val,
|
||||
const CefRect& rect_val,
|
||||
const CefRect& available_rect_val) {
|
||||
device_scale_factor = device_scale_factor_val;
|
||||
depth = depth_val;
|
||||
depth_per_component = depth_per_component_val;
|
||||
is_monochrome = is_monochrome_val;
|
||||
rect = rect_val;
|
||||
available_rect = available_rect_val;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -827,8 +827,8 @@ class CefPageRange : public CefStructBase<CefPageRangeTraits> {
|
|||
Set(from, to);
|
||||
}
|
||||
|
||||
void Set(int from, int to) {
|
||||
this->from = from, this->to = to;
|
||||
void Set(int from_val, int to_val) {
|
||||
from = from_val, to = to_val;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -85,7 +85,6 @@ size_t CefZipArchive::Load(CefRefPtr<CefStreamReader> stream,
|
|||
if (!reader->MoveToFirstFile())
|
||||
return 0;
|
||||
|
||||
CefRefPtr<CefZipFile> contents;
|
||||
FileMap::iterator it;
|
||||
size_t count = 0;
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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_);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue