mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-24 16:31:39 +01:00
0a98edff56
- Fix ASSERT in CefBrowserImpl::UIT_GetPagesCount() when no default printer is configured (Issue #20). - Remove non-existent WebFrame objects while iterating over the bound object list in CefJSContainer::BindToJavascript(). WebFrame objects are destroyed when navigating from a page with more frames to a page with less frames. If we don't remove the non-existent frames they will remain in the list until the browser window is destroyed. - Don't call UIT_* functions from class destructors as destruction may occur on a different thread. libcef: Update due to underlying chromium changes. - Header file locations changed from third_party/WebKit/WebKit to webkit/api as a result of WebKit unforking. - Project file locations changed due to GYP now being used for WebKit builds. - Add simple_clipboard_impl.cc in the libcef directory because it has been moved from webkit/glue to test_shell. - Changes related to navigation. - New parameters added to WebViewDelegate methods. libcef_dll: Update due to underlying chromium changes. - webkit_resources.rc and webkit_strings_en-US.rc moved from grit_derived_sources to obj/global_intermediate/webkit. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@24 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
// Copyright (c) 2008 The Chromium Embedded Framework Authors.
|
|
// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "precompiled_libcef.h"
|
|
#include "browser_drag_delegate.h"
|
|
|
|
#include <atltypes.h>
|
|
|
|
#include "webkit/api/public/WebPoint.h"
|
|
#include "webkit/glue/webview.h"
|
|
|
|
using WebKit::WebPoint;
|
|
|
|
|
|
namespace {
|
|
|
|
void GetCursorPositions(HWND hwnd, CPoint* client, CPoint* screen) {
|
|
// GetCursorPos will fail if the input desktop isn't the current desktop.
|
|
// See http://b/1173534. (0,0) is wrong, but better than uninitialized.
|
|
if (!GetCursorPos(screen))
|
|
screen->SetPoint(0, 0);
|
|
|
|
*client = *screen;
|
|
ScreenToClient(hwnd, client);
|
|
}
|
|
|
|
} // anonymous namespace
|
|
|
|
void BrowserDragDelegate::OnDragSourceCancel() {
|
|
OnDragSourceDrop();
|
|
}
|
|
|
|
void BrowserDragDelegate::OnDragSourceDrop() {
|
|
CPoint client;
|
|
CPoint screen;
|
|
GetCursorPositions(source_hwnd_, &client, &screen);
|
|
webview_->DragSourceEndedAt(WebPoint(client.x, client.y),
|
|
WebPoint(screen.x, screen.y));
|
|
}
|
|
|
|
void BrowserDragDelegate::OnDragSourceMove() {
|
|
CPoint client;
|
|
CPoint screen;
|
|
GetCursorPositions(source_hwnd_, &client, &screen);
|
|
webview_->DragSourceMovedTo(WebPoint(client.x, client.y),
|
|
WebPoint(screen.x, screen.y));
|
|
}
|