mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-23 15:37:51 +01:00
Windows: Fix VS2015 build errors in the binary distribution (issue #1692)
This commit is contained in:
parent
a566e4600e
commit
2e2154c784
@ -161,8 +161,8 @@ class CefPoint : public CefStructBase<CefPointTraits> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsEmpty() const { return x <= 0 && y <= 0; }
|
bool IsEmpty() const { return x <= 0 && y <= 0; }
|
||||||
void Set(int x, int y) {
|
void Set(int x_val, int y_val) {
|
||||||
this->x = x, this->y = y;
|
x = x_val, y = y_val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -202,8 +202,8 @@ class CefRect : public CefStructBase<CefRectTraits> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsEmpty() const { return width <= 0 || height <= 0; }
|
bool IsEmpty() const { return width <= 0 || height <= 0; }
|
||||||
void Set(int x, int y, int width, int height) {
|
void Set(int x_val, int y_val, int width_val, int height_val) {
|
||||||
this->x = x, this->y = y, this->width = width, this->height = height;
|
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; }
|
bool IsEmpty() const { return width <= 0 || height <= 0; }
|
||||||
void Set(int width, int height) {
|
void Set(int width_val, int height_val) {
|
||||||
this->width = width, this->height = height;
|
width = width_val, height = height_val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -285,8 +285,8 @@ class CefDraggableRegion : public CefStructBase<CefDraggableRegionTraits> {
|
|||||||
Set(bounds, draggable);
|
Set(bounds, draggable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set(const CefRect& bounds, bool draggable) {
|
void Set(const CefRect& bounds_val, bool draggable_val) {
|
||||||
this->bounds = bounds, this->draggable = draggable;
|
bounds = bounds_val, draggable = draggable_val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -340,18 +340,18 @@ class CefScreenInfo : public CefStructBase<CefScreenInfoTraits> {
|
|||||||
is_monochrome, rect, available_rect);
|
is_monochrome, rect, available_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set(float device_scale_factor,
|
void Set(float device_scale_factor_val,
|
||||||
int depth,
|
int depth_val,
|
||||||
int depth_per_component,
|
int depth_per_component_val,
|
||||||
bool is_monochrome,
|
bool is_monochrome_val,
|
||||||
const CefRect& rect,
|
const CefRect& rect_val,
|
||||||
const CefRect& available_rect) {
|
const CefRect& available_rect_val) {
|
||||||
this->device_scale_factor = device_scale_factor;
|
device_scale_factor = device_scale_factor_val;
|
||||||
this->depth = depth;
|
depth = depth_val;
|
||||||
this->depth_per_component = depth_per_component;
|
depth_per_component = depth_per_component_val;
|
||||||
this->is_monochrome = is_monochrome;
|
is_monochrome = is_monochrome_val;
|
||||||
this->rect = rect;
|
rect = rect_val;
|
||||||
this->available_rect = available_rect;
|
available_rect = available_rect_val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -827,8 +827,8 @@ class CefPageRange : public CefStructBase<CefPageRangeTraits> {
|
|||||||
Set(from, to);
|
Set(from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set(int from, int to) {
|
void Set(int from_val, int to_val) {
|
||||||
this->from = from, this->to = to;
|
from = from_val, to = to_val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,7 +85,6 @@ size_t CefZipArchive::Load(CefRefPtr<CefStreamReader> stream,
|
|||||||
if (!reader->MoveToFirstFile())
|
if (!reader->MoveToFirstFile())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
CefRefPtr<CefZipFile> contents;
|
|
||||||
FileMap::iterator it;
|
FileMap::iterator it;
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
|
|
||||||
|
@ -336,9 +336,9 @@ CefRefPtr<CefDragData> DataObjectToDragData(IDataObject* data_object) {
|
|||||||
HDROP hdrop = (HDROP)hGlobal;
|
HDROP hdrop = (HDROP)hGlobal;
|
||||||
const int kMaxFilenameLen = 4096;
|
const int kMaxFilenameLen = 4096;
|
||||||
const unsigned num_files = DragQueryFileW(hdrop, 0xffffffff, 0, 0);
|
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];
|
wchar_t filename[kMaxFilenameLen];
|
||||||
if (!DragQueryFileW(hdrop, i, filename, kMaxFilenameLen))
|
if (!DragQueryFileW(hdrop, x, filename, kMaxFilenameLen))
|
||||||
continue;
|
continue;
|
||||||
WCHAR* name = wcsrchr(filename, '\\');
|
WCHAR* name = wcsrchr(filename, '\\');
|
||||||
drag_data->AddFile(filename, (name ? name + 1 : filename));
|
drag_data->AddFile(filename, (name ? name + 1 : filename));
|
||||||
|
@ -80,7 +80,7 @@ class DropTargetWin : public IDropTarget {
|
|||||||
DWORD* effect);
|
DWORD* effect);
|
||||||
|
|
||||||
DEFAULT_QUERY_INTERFACE(IDropTarget)
|
DEFAULT_QUERY_INTERFACE(IDropTarget)
|
||||||
IUNKNOWN_IMPLEMENTATION()
|
IUNKNOWN_IMPLEMENTATION
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
DropTargetWin(OsrDragEvents* callback, HWND hWnd)
|
DropTargetWin(OsrDragEvents* callback, HWND hWnd)
|
||||||
@ -106,7 +106,8 @@ class DropSourceWin : public IDropSource {
|
|||||||
HRESULT __stdcall QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState);
|
HRESULT __stdcall QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState);
|
||||||
|
|
||||||
DEFAULT_QUERY_INTERFACE(IDropSource)
|
DEFAULT_QUERY_INTERFACE(IDropSource)
|
||||||
IUNKNOWN_IMPLEMENTATION()
|
IUNKNOWN_IMPLEMENTATION
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit DropSourceWin() : ref_count_(0) {}
|
explicit DropSourceWin() : ref_count_(0) {}
|
||||||
virtual ~DropSourceWin() {}
|
virtual ~DropSourceWin() {}
|
||||||
@ -137,7 +138,7 @@ class DragEnumFormatEtc : public IEnumFORMATETC {
|
|||||||
static void DeepCopyFormatEtc(FORMATETC *dest, FORMATETC *source);
|
static void DeepCopyFormatEtc(FORMATETC *dest, FORMATETC *source);
|
||||||
|
|
||||||
DEFAULT_QUERY_INTERFACE(IEnumFORMATETC)
|
DEFAULT_QUERY_INTERFACE(IEnumFORMATETC)
|
||||||
IUNKNOWN_IMPLEMENTATION()
|
IUNKNOWN_IMPLEMENTATION
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ULONG m_nIndex; // current enumerator index
|
ULONG m_nIndex; // current enumerator index
|
||||||
@ -171,7 +172,7 @@ class DataObjectWin : public IDataObject {
|
|||||||
HRESULT __stdcall GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium);
|
HRESULT __stdcall GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium);
|
||||||
|
|
||||||
DEFAULT_QUERY_INTERFACE(IDataObject)
|
DEFAULT_QUERY_INTERFACE(IDataObject)
|
||||||
IUNKNOWN_IMPLEMENTATION()
|
IUNKNOWN_IMPLEMENTATION
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_nNumFormats;
|
int m_nNumFormats;
|
||||||
|
@ -509,7 +509,6 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) {
|
|||||||
last_click_time_ = currentTime;
|
last_click_time_ = currentTime;
|
||||||
last_click_button_ = btnType;
|
last_click_button_ = btnType;
|
||||||
|
|
||||||
CefRefPtr<CefBrowserHost> browser_host = browser_->GetHost();
|
|
||||||
if (browser_host) {
|
if (browser_host) {
|
||||||
CefMouseEvent mouse_event;
|
CefMouseEvent mouse_event;
|
||||||
mouse_event.x = x;
|
mouse_event.x = x;
|
||||||
|
@ -319,11 +319,11 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings) {
|
|||||||
|
|
||||||
if (with_controls_) {
|
if (with_controls_) {
|
||||||
// Create the child controls.
|
// Create the child controls.
|
||||||
int x = 0;
|
int x_offset = 0;
|
||||||
|
|
||||||
static int button_width = GetButtonWidth();
|
const int button_width = GetButtonWidth();
|
||||||
static int urlbar_height = GetURLBarHeight();
|
const int urlbar_height = GetURLBarHeight();
|
||||||
static int font_height =
|
const int font_height =
|
||||||
LogicalToDevice(14, client::GetDeviceScaleFactor());
|
LogicalToDevice(14, client::GetDeviceScaleFactor());
|
||||||
|
|
||||||
// Create a scaled font.
|
// Create a scaled font.
|
||||||
@ -335,46 +335,46 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings) {
|
|||||||
back_hwnd_ = CreateWindow(
|
back_hwnd_ = CreateWindow(
|
||||||
L"BUTTON", L"Back",
|
L"BUTTON", L"Back",
|
||||||
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED,
|
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);
|
hwnd_, reinterpret_cast<HMENU>(IDC_NAV_BACK), hInstance, 0);
|
||||||
CHECK(back_hwnd_);
|
CHECK(back_hwnd_);
|
||||||
SendMessage(back_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
|
SendMessage(back_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
|
||||||
x += button_width;
|
x_offset += button_width;
|
||||||
|
|
||||||
forward_hwnd_ = CreateWindow(
|
forward_hwnd_ = CreateWindow(
|
||||||
L"BUTTON", L"Forward",
|
L"BUTTON", L"Forward",
|
||||||
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED,
|
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);
|
hwnd_, reinterpret_cast<HMENU>(IDC_NAV_FORWARD), hInstance, 0);
|
||||||
CHECK(forward_hwnd_);
|
CHECK(forward_hwnd_);
|
||||||
SendMessage(forward_hwnd_, WM_SETFONT,
|
SendMessage(forward_hwnd_, WM_SETFONT,
|
||||||
reinterpret_cast<WPARAM>(font_), TRUE);
|
reinterpret_cast<WPARAM>(font_), TRUE);
|
||||||
x += button_width;
|
x_offset += button_width;
|
||||||
|
|
||||||
reload_hwnd_ = CreateWindow(
|
reload_hwnd_ = CreateWindow(
|
||||||
L"BUTTON", L"Reload",
|
L"BUTTON", L"Reload",
|
||||||
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON| WS_DISABLED,
|
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);
|
hwnd_, reinterpret_cast<HMENU>(IDC_NAV_RELOAD), hInstance, 0);
|
||||||
CHECK(reload_hwnd_);
|
CHECK(reload_hwnd_);
|
||||||
SendMessage(reload_hwnd_, WM_SETFONT,
|
SendMessage(reload_hwnd_, WM_SETFONT,
|
||||||
reinterpret_cast<WPARAM>(font_), TRUE);
|
reinterpret_cast<WPARAM>(font_), TRUE);
|
||||||
x += button_width;
|
x_offset += button_width;
|
||||||
|
|
||||||
stop_hwnd_ = CreateWindow(
|
stop_hwnd_ = CreateWindow(
|
||||||
L"BUTTON", L"Stop",
|
L"BUTTON", L"Stop",
|
||||||
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED,
|
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);
|
hwnd_, reinterpret_cast<HMENU>(IDC_NAV_STOP), hInstance, 0);
|
||||||
CHECK(stop_hwnd_);
|
CHECK(stop_hwnd_);
|
||||||
SendMessage(stop_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
|
SendMessage(stop_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
|
||||||
x += button_width;
|
x_offset += button_width;
|
||||||
|
|
||||||
edit_hwnd_ = CreateWindow(
|
edit_hwnd_ = CreateWindow(
|
||||||
L"EDIT", 0,
|
L"EDIT", 0,
|
||||||
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL |
|
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL |
|
||||||
ES_AUTOHSCROLL| WS_DISABLED,
|
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);
|
hwnd_, 0, hInstance, 0);
|
||||||
SendMessage(edit_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
|
SendMessage(edit_hwnd_, WM_SETFONT, reinterpret_cast<WPARAM>(font_), TRUE);
|
||||||
CHECK(edit_hwnd_);
|
CHECK(edit_hwnd_);
|
||||||
|
@ -103,13 +103,13 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||||||
CEF_REQUIRE_UI_THREAD();
|
CEF_REQUIRE_UI_THREAD();
|
||||||
|
|
||||||
// Only handle messages from the test URL.
|
// Only handle messages from the test URL.
|
||||||
const std::string& url = frame->GetURL();
|
std::string url = frame->GetURL();
|
||||||
if (url.find(kTestUrl) != 0)
|
if (url.find(kTestUrl) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const std::string& message_name = request;
|
const std::string& message_name = request;
|
||||||
if (message_name.find(kTestMessageName) == 0) {
|
if (message_name.find(kTestMessageName) == 0) {
|
||||||
const std::string& url = message_name.substr(sizeof(kTestMessageName));
|
url = message_name.substr(sizeof(kTestMessageName));
|
||||||
|
|
||||||
CancelPendingRequest();
|
CancelPendingRequest();
|
||||||
|
|
||||||
@ -119,20 +119,20 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||||||
callback_ = callback;
|
callback_ = callback;
|
||||||
|
|
||||||
// Create a CefRequest for the specified URL.
|
// Create a CefRequest for the specified URL.
|
||||||
CefRefPtr<CefRequest> request = CefRequest::Create();
|
CefRefPtr<CefRequest> cef_request = CefRequest::Create();
|
||||||
request->SetURL(url);
|
cef_request->SetURL(url);
|
||||||
request->SetMethod("GET");
|
cef_request->SetMethod("GET");
|
||||||
|
|
||||||
// Callback to be executed on request completion.
|
// Callback to be executed on request completion.
|
||||||
// It's safe to use base::Unretained() here because there is only one
|
// It's safe to use base::Unretained() here because there is only one
|
||||||
// RequestClient pending at any given time and we explicitly detach the
|
// RequestClient pending at any given time and we explicitly detach the
|
||||||
// callback in the Handler destructor.
|
// callback in the Handler destructor.
|
||||||
const RequestClient::Callback& callback =
|
const RequestClient::Callback& request_callback =
|
||||||
base::Bind(&Handler::OnRequestComplete, base::Unretained(this));
|
base::Bind(&Handler::OnRequestComplete, base::Unretained(this));
|
||||||
|
|
||||||
// Create and start the new CefURLRequest.
|
// Create and start the new CefURLRequest.
|
||||||
urlrequest_ = CefURLRequest::Create(request,
|
urlrequest_ = CefURLRequest::Create(cef_request,
|
||||||
new RequestClient(callback),
|
new RequestClient(request_callback),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user